Comprehensive Rust(繁体中文) 202406
cargo rust-src rustfmt 2.1 Rust 生態系統 Rust 生態系統包含多項工具,以下列出主要工具: • rustc:Rust 編譯器,可將 .rs 檔案轉換成二進位檔和其他中繼格式。 • cargo: the Rust dependency manager and build tool. Cargo knows how to download dependencies, usually 行 Rust Playground 開頭的「hello-world」程式。Playground 兼具以下幾項便利功能: • 在「Tools」下方點選「rustfmt」選項,以「標準」方式設定程式碼格式。 • Rust 有兩個主要的「設定檔」可產生程式碼,分別是「Debug」(加強執行階段檢查,最佳化程度較低) 和「Release」(減少執行階段檢查,大規模最佳化)。這些設定檔位於頂端的「Debug」下方。 the debug output. This means that we must use debug output here. • 加入 # (例如 {a:#?}) 可叫用方便閱讀的「美化排版」格式。 37 8.2 元組 fn main() { let t: (i8, bool) = (7, true); println!("t.0: {}", t.0); println!("t.1:0 码力 | 356 页 | 1.41 MB | 1 年前3
共 1 条
- 1