Radish alpha
r
rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt
Git libraries for Radicle
Radicle
Git
clippy: use `io::Error::other`
Fintan Halpenny committed 4 months ago
commit 10333caec799d772247c776b478d16ae38ea5bf7
parent 68d6fa8
4 files changed +6 -8
modified radicle-git-ext/src/error.rs
@@ -13,5 +13,5 @@ pub fn into_git_err<E: Display>(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)
}
modified 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(),
modified radicle-git-ext/t/src/repository.rs
@@ -87,5 +87,5 @@ fn io_other<E>(e: E) -> io::Error
where
    E: std::error::Error + Send + Sync + 'static,
{
-
    io::Error::new(io::ErrorKind::Other, e)
+
    io::Error::other(e)
}
modified 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)?,
            ))
        })
    }