moved string stuff to it's own file
This commit is contained in:
+2
-2
@@ -1,3 +1,4 @@
|
||||
mod string;
|
||||
mod fmt_debug;
|
||||
|
||||
// when a String is passed to this function a move occurs:
|
||||
@@ -41,6 +42,7 @@ fn _get_static_str() -> &'static str {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
fmt_debug::test_report();
|
||||
|
||||
let s = String::new(); // no heap allocation until we add characters (capacity > 0)
|
||||
@@ -78,6 +80,4 @@ fn main() {
|
||||
let _s6 = String::from(s_lit); //underlying data copied to heap
|
||||
|
||||
// todo: Cow
|
||||
|
||||
println!("Hello, world!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user