News for hackers. Stuff that matters.
Re:Why Rust closures are somewhat hard by steveklabnik on Monday September 10, 2018 @05:33PM (#17955405)
You're welcome! I have had a lot more time to familiarize myself with the standard library than you probably have.

That being said.. A lot of this stuff is things that already exist that you don't need to write yourself. dirname, basename, join, even s is .to_string. It's also the same as str. getenv is env().unwrap_or().

> Curious about that block in particular.

I would call https://doc.rust-lang.org/std/fs/fn.canonicalize.html and be done with it, instead of importing libc and going through all of this.

In the end, this should be like 40LOC, 50 tops, if you made use of the standard library rather than trying to re-implement it all :)

There are no comments on this comment yet.