Re:FasterPath: Faster Pathname Handling for Ruby Written in ...
by nilved on Friday June 17, 2016 @12:20PM
(#11923558)
I 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.
Re:FasterPath: Faster Pathname Handling for Ruby Written in ...
by gue5t on Friday June 17, 2016 @12:31PM
(#11923616)
A more idiomatic way to write the line is:
r_str.chars().next() == Some(MAIN_SEPARATOR)
Re:FasterPath: Faster Pathname Handling for Ruby Written in ...
by jason_dstillery on Friday June 17, 2016 @01:20PM
(#11923981)
It'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.
Re:FasterPath: Faster Pathname Handling for Ruby Written in ...
by Sarkie on Friday June 17, 2016 @12:09PM
(#11923465)
Not a clue.
http://www.rubydoc.info/gems/muffins/0.0.6
Maybe?
Hilarious find though.
Re:FasterPath: Faster Pathname Handling for Ruby Written in ...
by blacksmith_tb on Friday June 17, 2016 @12:08PM
(#11923461)
I haven't worked with Rust myself, but I read that as a failover/rescue, to provide a string for debugging purposes (hence the silliness).
Edit: changed link to blob version which will not change line numbers on me.