diff --git a/radicle-git-ext/src/error.rs b/radicle-git-ext/src/error.rs index b5681ec..b8433e3 100644 --- a/radicle-git-ext/src/error.rs +++ b/radicle-git-ext/src/error.rs @@ -13,5 +13,5 @@ pub fn into_git_err(e: E) -> git2::Error { } pub fn into_io_err(e: git2::Error) -> io::Error { - io::Error::new(io::ErrorKind::Other, e) + io::Error::other(e) } diff --git a/radicle-git-ext/t/src/commit.rs b/radicle-git-ext/t/src/commit.rs index 4c33376..a08e3d7 100644 --- a/radicle-git-ext/t/src/commit.rs +++ b/radicle-git-ext/t/src/commit.rs @@ -159,7 +159,7 @@ proptest! { #[test] fn valid_commits(commits in proptest::collection::vec(gen::commit::commit(), 5..20)) { let repo = tempdir::WithTmpDir::new(|path| { - git2::Repository::init(path).map_err(|e| io::Error::new(io::ErrorKind::Other, e)) + git2::Repository::init(path).map_err(io::Error::other) }).unwrap(); let commits = gen::commit::write_commits(&repo, commits).unwrap(); repo.reference("refs/heads/master", *commits.last().unwrap(), true, "").unwrap(); @@ -177,10 +177,8 @@ proptest! { #[test] fn write_valid_commit() { - let repo = WithTmpDir::new(|path| { - git2::Repository::init(path).map_err(|err| io::Error::new(io::ErrorKind::Other, err)) - }) - .unwrap(); + let repo = + WithTmpDir::new(|path| git2::Repository::init(path).map_err(io::Error::other)).unwrap(); let author = Author { name: "Terry".to_owned(), diff --git a/radicle-git-ext/t/src/repository.rs b/radicle-git-ext/t/src/repository.rs index 56f580a..d03325e 100644 --- a/radicle-git-ext/t/src/repository.rs +++ b/radicle-git-ext/t/src/repository.rs @@ -87,5 +87,5 @@ fn io_other(e: E) -> io::Error where E: std::error::Error + Send + Sync + 'static, { - io::Error::new(io::ErrorKind::Other, e) + io::Error::other(e) } diff --git a/radicle-surf/build.rs b/radicle-surf/build.rs index 54760a9..5fda4df 100644 --- a/radicle-surf/build.rs +++ b/radicle-surf/build.rs @@ -21,7 +21,7 @@ impl Command { Self::Build(current) } else { Self::Publish(PathBuf::from( - env::var("OUT_DIR").map_err(|err| io::Error::new(io::ErrorKind::Other, err))?, + env::var("OUT_DIR").map_err(io::Error::other)?, )) }) }