Skip to content
This repository was archived by the owner on Apr 13, 2022. It is now read-only.

Use errno from the standard library#1

Merged
tomaka merged 2 commits into
paritytech:masterfrom
tomaka:fix-errno
Feb 28, 2018
Merged

Use errno from the standard library#1
tomaka merged 2 commits into
paritytech:masterfrom
tomaka:fix-errno

Conversation

@tomaka
Copy link
Copy Markdown

@tomaka tomaka commented Feb 28, 2018

Use the errno capabilities of the Rust standard library instead of having platform-specific code.

The code was grabbed from this PR: knsd#23
Since the author has deleted their repo, I just copy-pasted the code instead of picking the commit.

Comment thread src/lib.rs Outdated
}

fn errno() -> Errno {
io::Error::last_os_error().raw_os_error().unwrap()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have expect("last_os_error produces only OS errors hence raw_os_error cannot be None") instead of unwrap?

@tomaka tomaka merged commit df00295 into paritytech:master Feb 28, 2018
@tomaka tomaka deleted the fix-errno branch February 28, 2018 17:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants