For this contrived rust code:
use std::io;
fn main() {
println!("Enter the number:");
let constant = "!";
let mut guess = String::new();
io::stdin().read_line(&mut guess)
.expect("failed to readline");
print!("You entered {}{}\n", guess, constant);
print!("You entered {}{}\n", &guess[..1], constant);
}
the output is
Enter the number:
1
You entered 1
!
You entered 1!
and not
Enter the number:
1
You entered 1!
You entered 1!
Is rust adding extra special such as newline chars to the input string?