// ANCHOR: here fn last_char_of_first_line(text: &str) -> Option { text.lines().next()?.chars().last() } // ANCHOR_END: here fn main() { assert_eq!( last_char_of_first_line("Hello, world\nHow are you today?"), Some('d') ); assert_eq!(last_char_of_first_line(""), None); assert_eq!(last_char_of_first_line("\nhi"), None); }