mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-11-16 00:10:35 +08:00
meta: use long crate names
To help with clarity and potential publishing of the crates, the full `radicle-` prefix is used for the crate names. Note that it wasn't chosen got `git-ref-format` and `git-trailers` since they are truly general libraries (bar the feature flag for link specific reference names). Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// Copyright © 2019-2020 The Radicle Foundation <hello@radicle.foundation>
|
||||
//
|
||||
// This file is part of radicle-link, distributed under the GPLv3 with Radicle
|
||||
// Linking Exception. For full terms see the included LICENSE file.
|
||||
|
||||
use std::{fmt::Display, io};
|
||||
|
||||
pub fn is_not_found_err(e: &git2::Error) -> bool {
|
||||
e.code() == git2::ErrorCode::NotFound
|
||||
}
|
||||
|
||||
pub fn is_exists_err(e: &git2::Error) -> bool {
|
||||
e.code() == git2::ErrorCode::Exists
|
||||
}
|
||||
|
||||
pub fn into_git_err<E: Display>(e: E) -> git2::Error {
|
||||
git2::Error::from_str(&e.to_string())
|
||||
}
|
||||
|
||||
pub fn into_io_err(e: git2::Error) -> io::Error {
|
||||
io::Error::new(io::ErrorKind::Other, e)
|
||||
}
|
||||
Reference in New Issue
Block a user