You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fnmain(){for line in"a\r".lines(){println!("{:?}", line);}}
I expected to see this happen: "a\r" to be printed.
Instead, this happened: "a" is being printed.
At this point fixing this behavior may break actual code (and this would be a quiet change), however documenting this may make sense. This behavior was introduced in Rust 1.4.0 as a result of implementation of RFC 1212.
Curiously, BufRead::lines whose behavior was changed by the same RFC doesn't have this issue. It makes sure that \r is followed by \n before deleting the carriage return.