Str and String equality
fn main() { let a = "hello"; let b = "hello"; let c = String::from("hello"); let d = String::from("hello"); println!("{}", a == b); println!("{}", a == c); println!("{}", c == d); }
true
true
true
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
fn main() { let a = "hello"; let b = "hello"; let c = String::from("hello"); let d = String::from("hello"); println!("{}", a == b); println!("{}", a == c); println!("{}", c == d); }
true
true
true