How’s it going, I'm a Adam, a Full-Stack Engineer, actively searching for work. I'm all about JavaScript. And Frontend but don't let that fool you - I've also got some serious Backend skills.
Location
City of Bath, UK 🇬🇧
Education
10 plus years* active enterprise development experience and a Fine art degree 🎨
How’s it going, I'm a Adam, a Full-Stack Engineer, actively searching for work. I'm all about JavaScript. And Frontend but don't let that fool you - I've also got some serious Backend skills.
Location
City of Bath, UK 🇬🇧
Education
10 plus years* active enterprise development experience and a Fine art degree 🎨
I hadn't seen any issues with it in my own usage, but there's also path_abs, an external crate which solves this problem. So, the existence of the crate says that there probably is something I don't know about! Good luck.
That's an artifact of how rust generally handles errors - all functions return a Result<T, E>. The variants of this type are Ok(T) or Err(E). Functions that don't return a value end up with an Ok(()), signalling success and returning unit. You can only use ? in a fn that returns a Result
How’s it going, I'm a Adam, a Full-Stack Engineer, actively searching for work. I'm all about JavaScript. And Frontend but don't let that fool you - I've also got some serious Backend skills.
Location
City of Bath, UK 🇬🇧
Education
10 plus years* active enterprise development experience and a Fine art degree 🎨
So it looks like the airquotes problem with canonicalize is that it looks at the real FS. In a cli tool where foo/ is not a dir this would panic (that to me is a real strength!) This is substantially better than node path where it's just a string. Just need catch the error. IL share working code soon.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
also, interesting that this is part of the fs module. As I said before, I am used to node where this would be part of the path module.
Also one last thing, what the heck is Ok(()), I keep seeing this in the docs.
I hadn't seen any issues with it in my own usage, but there's also path_abs, an external crate which solves this problem. So, the existence of the crate says that there probably is something I don't know about! Good luck.
That's an artifact of how rust generally handles errors - all functions return a
Result<T, E>
. The variants of this type areOk(T)
orErr(E)
. Functions that don't return a value end up with anOk(())
, signalling success and returning unit. You can only use?
in a fn that returns aResult
So it looks like the airquotes problem with canonicalize is that it looks at the real FS. In a cli tool where foo/ is not a dir this would panic (that to me is a real strength!) This is substantially better than node path where it's just a string. Just need catch the error. IL share working code soon.