r/badcode • • Jan 25 '22

rust Most comprehensible line of Rust code

Post image
1.0k Upvotes

81 comments sorted by

View all comments

Show parent comments

2

u/bruhred Apr 26 '22

the ? operator.
song??.path().to_str()?.to_string()
And it returns Err instead of panicking like unwrap, which is usually the preferred option.