Skip to content
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

Merged
merged 1 commit into from
Aug 8, 2017

Conversation

paulpr0
Copy link
Contributor

@paulpr0 paulpr0 commented Aug 3, 2017

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.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 0.0% when pulling b8eda81 on paulpr0:master into 5a7dbf3 on oconnor663:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same at 0.0% when pulling b8eda81 on paulpr0:master into 5a7dbf3 on oconnor663:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 0.0% when pulling b8eda81 on paulpr0:master into 5a7dbf3 on oconnor663:master.

io::Error::new(ErrorKind::InvalidData, err)
}
}
}
Copy link
Owner

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?

Copy link
Contributor Author

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.

Copy link
Owner

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)
Copy link
Owner

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.

Copy link
Owner

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants