4 ms·
I'm not at all familiar with programming in Rust or Ruby, but what is the significance of the string "muffins" on this line? https://github.com/danielpclark/fas
by idbehold 10y ago
I'm not at all familiar with programming in Rust or Ruby, but what is the significance of the string "muffins" on this line? https://github.com/danielpclark/faster_path/blob/7033f5a567317d96d8a9cff0ade2327ecfb1d32b/src/is_absolute.rs#L17 https://github.com/danielpclark/faster_path/blob/7033f5a5673...
Edit: changed link to blob version which will not change line numbers on me.
- blacksmith_tb 10y agoI haven't worked with Rust myself, but I read that as a failover/rescue, to provide a string for debugging purposes (hence the silliness).
- Sarkie 10y agoNot a clue. http://www.rubydoc.info/gems/muffins/0.0.6 http://www.rubydoc.info/gems/muffins/0.0.6 Maybe? Hilarious find though.
- nilved 10y agoI don't write Rust either, but I might guess that they are trying to unbox a nullable value that can't be null. They need a default string due to Rusts strong types even if it's not used.
- gue5t 10y agoA more idiomatic way to write the line is: r_str.chars().next() == Some(MAIN_SEPARATOR)
- jason_dstillery 10y agoIt's a string whose first character is guaranteed not to match MAIN_SEPARATOR, so that the expression always returns false when r_str is empty. Definitely not the clearest way to do that.