moved string stuff to it's own file

This commit is contained in:
2026-04-25 06:41:01 -04:00
committed by edgul
parent 591b122c81
commit 0c9a7ec030
2 changed files with 85 additions and 2 deletions
+2 -2
View File
@@ -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!");
}