fn process_string(s: String) { println!("Processing: {}", s); // s is moved here, can no longer be used in main } fn analyze_slice(s: &str) { println!("Analyzing slice: {}", s); // s is borrowed, original owner still retains ownership } fn main() { let my_string = String::from("Hello, Rust!"); // my_string owns the data process_string(my_string); // my_string is MOVED here, original my_string can no longer be used // This line would cause a compile-time error because my_string was moved: // println!("{}", my_string); let another_string = String::from("Immutable reference example"); analyze_slice(&another_string); // another_string is BORROWED println!("Original string after analysis: {}", another_string); // another_string can still be used }