Sean1708 / rusty-cheddar

A Rust crate for automatically generating C header files from Rust source file.
http://sean1708.github.io/rusty-cheddar/
191 stars 25 forks source link

Generate the include guard cleanly. #7

Closed Sean1708 closed 8 years ago

Sean1708 commented 8 years ago

Currently this is done like so

header_path.file_stem().map(|p| p.to_str().unwrap_or("default")).unwrap_or("default"),

because both .file_stem() and .to_str() return Option. Is there a cleaner way to do this? Should we die if we can't get the .file_stem() (because it might suggest problems down the road)?

Sean1708 commented 8 years ago

How about display?