-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade nix to 0.9 (map nix::Error to io::Error) #10
Conversation
2 similar comments
io::Error::new(ErrorKind::InvalidData, err) | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Sorry for taking a while to get to it. Seems unfortunate that we need to implement this conversion ourselves -- does nix not provide anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conversion was removed in nix as part of nix-rust/nix#614
And discussed here nix-rust/nix#613 (see the end of the thread 22Jul17) - so it seems to be intentional.
I'm not involved with the nix project, but there is talk about improving the structure of error handling in nix in the same threads mentioned above, so hopefully there will be something nicer in future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking in with the source of truth: nix-rust/nix#723
io::Error::from(err_no) | ||
} | ||
_ => { | ||
io::Error::new(ErrorKind::InvalidData, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would rather this be a panic!
, since it's really not expected, and if it ever starts happening we want to know about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll merge this as-is, and then I'll make that change on top of it. Thanks!
Hi, I've made a small change to allow updating the version of nix. I'm fairly new to rust and to github, so sorry if I've got anything wrong.