Comprehensive Rust(繁体中文) 202406&str 或 String。 • 當型別實作 Deref時,編譯器可讓您以公開透明的方式呼叫 T 中的方法。 80 – 我們尚未討論 Deref 特徵,因此目前主要會講解說明文件中的側欄結構。 – String 會實作 Deref ,後者能以公開透明的方式授予前者 str 方法的 存取權。 – Write and compare let s3 = hi = make_greeter("Hi".to_string()); hi("Greg"); } 17.8 練習:ROT13 (迴轉 13 位) 在這個範例中,您將實作傳統的「ROT13」加密方式。請將此程式碼複製到 Playground,並實作缺少的位 元。記得僅能旋轉 ASCII 字母字元,確保結果仍為有效的 UTF-8。 use std::io::Read; struct RotDecoder 0 码力 | 356 页 | 1.41 MB | 1 年前3
共 1 条
- 1













