-
Notifications
You must be signed in to change notification settings - Fork 31
add and export path_abs crate #20
Comments
That's a very cool crate! I might use it in some of my projects :) I only added read_file and write_to_file functions for now. What other operations that you typically have in CLI tools are covered by path_abs? And: Can it give really nice errors? :) |
it uses The benefit of path_abs is that it makes composition easier. You can write a function that takes a file as an input (instead of a path). That file is guaranteed to exist and be absolute! Also, the file itself is easy to make ( I am questioning a bit whether this crate should rexport much outside of the initial |
closing per #19 |
Yeah, it's a really elegant design – I also like that you added a
Ugh, yeah, they sadly carry a little less context information than I want to have… Why'd you chose to go with io:Error? Performance? Oh—Here's a weird idea for errors (and totally off topic of course): Can you make an error type like |
The main reason is to mimick However... that is an extremely interesting thought. Before I go too far into it, your main problem with If that is the case, I could see a point of having a Hmm... or we could create an alternate I'm not 100% sure I can see what needs to be made, but I agree that the current error messages are bad. I've had multiple occaisions where I've been pissed the file information was not included automatically (I get why it isn't for performance reasons). |
huh, I just realized that the signature of
It looks like it can take any type which implements error. I thought it could only take a |
prints
|
I could even do something like |
I've been thinking of adding a |
I am the creator and maintainer of the new path_abs crate and I think it solves a lot of ergonomic problems in rust (problems I see you re-solving with the
fs
module!).Questions:
path_abs
types?fs
module be deprecated?Thanks!
The text was updated successfully, but these errors were encountered: