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()?
    }
相关推荐
UestcXiye3 小时前
Rust 学习笔记:函数和控制流
rust
Source.Liu8 小时前
【mdlib】0 全面介绍 mdlib - Rust 实现的 Markdown 工具集
rust·markdown
机构师9 小时前
<rust><iced><GUI>iced中的复合列表部件:combo_box
后端·rust
景天科技苑13 小时前
【Rust】Rust中的枚举与模式匹配,原理解析与应用实战
开发语言·后端·rust·match·enum·枚举与模式匹配·rust枚举与模式匹配
红尘散仙14 小时前
七、WebGPU 基础入门——Texture 纹理
前端·rust·gpu
红尘散仙14 小时前
八、WebGPU 基础入门——加载图像纹理
前端·rust·gpu
w4ngzhen14 小时前
关于Bevy中的原型Archetypes
rust·游戏开发
sayornottt16 小时前
Rust中的动态分发
后端·rust
YiSLWLL1 天前
使用Tauri 2.3.1+Leptos 0.7.8开发桌面小程序汇总
python·rust·sqlite·matplotlib·visual studio code
yu4106211 天前
Rust 语言使用场景分析
开发语言·后端·rust