collections/String #236
Replies: 18 comments 7 replies
-
易混淆概念解析 - &str 和 String 链接失效了 |
Beta Was this translation helpful? Give feedback.
-
第7题为何要阻止 story 自动销毁呢: |
Beta Was this translation helpful? Give feedback.
-
这里有人能帮我解释一下这个问题吗?谢谢了
我看了下as_mut_ptr的函数签名:
story明明是个不可变变量, 为什么可以作为可变引用传入方法? |
Beta Was this translation helpful? Give feedback.
-
第三题是String::from("hello, world");一次然后to_string();一次吗 |
Beta Was this translation helpful? Give feedback.
-
done lala~ |
Beta Was this translation helpful? Give feedback.
-
作者大大,本节页面的中英文跳转有问题,点击页面右上角按钮进行中英文页面间相互跳转,会跳到404页面.已提交pr: #442 |
Beta Was this translation helpful? Give feedback.
-
第三题共发生了两次堆内存分配。 |
Beta Was this translation helpful? Give feedback.
-
这个的学习页面怎么没有了?只有动态数组和HashMap |
Beta Was this translation helpful? Give feedback.
-
第五题:
这个设计允许调用者通过匹配 let v = vec![104, 101, 108, 108, 111]; // 字节代表 "hello"
let result = String::from_utf8(v);
match result {
Ok(string) => println!("Converted string: {}", string),
Err(e) => println!("Failed to convert: {}", e),
} 使用 |
Beta Was this translation helpful? Give feedback.
-
mark finished |
Beta Was this translation helpful? Give feedback.
-
collections/String
Learning Rust By Practice, narrowing the gap between beginner and skilled-dev with challenging examples, exercises and projects.
https://zh.practice.rs/collections/String.html
Beta Was this translation helpful? Give feedback.
All reactions