Rust Tips

Cargo

cargo new vs cargo init

  • cargo new 是产生一个新目录
  • cargo init 是在已有目录下初始化文件,比如 git clone 后

Rust programming

如何判断字符串是标点符号

rust 复制代码
let term = "...";
if term.chars().all(|c| c.is_ascii_punctuation()) {
    
}

match 强大之处

diff 复制代码
match (request.method(), request.url()) {
-    (Method::Get, "/" | (Method::Get, "/index.html" | (Method::Get, "/index") => {
+    (Method::Get, "/" | "/index.html" | "/index") => {
        serve_index()?
    }
相关推荐
程工造Agent14 小时前
从 0 到 1 学 Codex 源码:顺着 main 读懂 Rust 闭包与 async move
rust·ai编程
shimly12345619 小时前
(done) RUST 指针详解
rust
geovindu20 小时前
rust: Template Method Pattern
开发语言·后端·设计模式·rust·行为模式·模板方法模
遇码21 小时前
Rust 桌面应用自托管自动更新:latest.json 清单 + minisign 签名校验的完整做法
人工智能·ai·rust·大模型·agent
geovindu21 小时前
rust: Template Method Pattern(续)
开发语言·后端·设计模式·rust·行为模式·板方法模式
niyongsheng1 天前
多智能体连续时间内路径规划:AA-SIPP(m) 的 Rust 实现与算法
算法·rust·机器人
NetX行者2 天前
Rust 初体验:一个全栈工程师的编译器“毒打“笔记
开发语言·笔记·rust
Amos_Web2 天前
Rspack 源码解析(二十七):AsyncWasmParserAndGenerator 如何把二进制变成异步模块
前端·rust
敲代码的玉米C2 天前
菜单栏做出来了,内存预算却没过:Hostwatch 开发手记(二)
rust
敲代码的玉米C2 天前
电脑卡了,然后呢?我想用 Rust 做一个 Mac 诊断小工具
rust