From 132f29ae9dabb8cb55b7fb9e7d492ee526c57584 Mon Sep 17 00:00:00 2001 From: Fredrik Klingenberg Date: Sun, 19 Nov 2023 20:18:45 +0100 Subject: [PATCH] push string examples Signed-off-by: Fredrik Klingenberg --- projects/collections/src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/projects/collections/src/main.rs b/projects/collections/src/main.rs index 61aec9e..b0d47f6 100644 --- a/projects/collections/src/main.rs +++ b/projects/collections/src/main.rs @@ -49,4 +49,12 @@ fn main() { } } + let s = String::new(); + let _reference = &s; + let data = "initial contents"; + let mut _s = data.to_string(); + let s2 = "initial contents"; + _s.push_str(s2); + println!("{s2}"); + }