switch from failure to anyhow

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2020-04-17 14:11:25 +02:00
parent 404d78c41e
commit f7d4e4b506
116 changed files with 129 additions and 129 deletions

View File

@ -3,7 +3,7 @@
//! A file list catalog simply store a directory tree. Such catalogs
//! may be used as index to do a fast search for files.
use failure::*;
use anyhow::{Error};
use std::ffi::CStr;
pub trait BackupCatalogWriter {

View File

@ -8,7 +8,7 @@ use std::io::{Read, Seek, SeekFrom};
use std::path::{Path, PathBuf};
use std::os::unix::ffi::OsStrExt;
use failure::*;
use anyhow::{bail, format_err, Error};
use libc;
use super::binary_search_tree::search_binary_tree_by;

View File

@ -2,7 +2,7 @@ use std::ffi::{OsStr, OsString};
use std::os::unix::io::{AsRawFd, RawFd};
use std::path::PathBuf;
use failure::{format_err, Error};
use anyhow::{format_err, Error};
use nix::errno::Errno;
use nix::fcntl::OFlag;
use nix::sys::stat::Mode;

View File

@ -10,7 +10,7 @@ use std::os::unix::io::RawFd;
use std::path::{Path, PathBuf};
use endian_trait::Endian;
use failure::*;
use anyhow::{bail, format_err, Error};
use nix::errno::Errno;
use nix::fcntl::OFlag;
use nix::sys::stat::FileStat;

View File

@ -7,7 +7,7 @@
use std::cmp::Ordering;
use endian_trait::Endian;
use failure::{bail, Error};
use anyhow::{bail, Error};
use siphasher::sip::SipHasher24;

View File

@ -11,7 +11,7 @@ use std::os::unix::ffi::OsStrExt;
use std::path::Path;
use std::sync::Mutex;
use failure::{bail, format_err, Error};
use anyhow::{bail, format_err, Error};
use libc;
use libc::{c_char, c_int, c_void, size_t};

View File

@ -10,7 +10,7 @@ use std::fs::File;
use std::io::Read;
use std::os::unix::io::{FromRawFd, RawFd};
use failure::{bail, Error};
use anyhow::{bail, Error};
use libc::{c_char, c_int};
use nix::errno::Errno;
use nix::fcntl;
@ -44,7 +44,7 @@ pub enum MatchType {
/// ```
/// # use std::ffi::CString;
/// # use self::proxmox_backup::pxar::{MatchPattern, MatchType};
/// # fn main() -> Result<(), failure::Error> {
/// # fn main() -> Result<(), anyhow::Error> {
/// let filename = CString::new("some.conf")?;
/// let is_dir = false;
///
@ -223,7 +223,7 @@ impl<'a> MatchPatternSlice<'a> {
/// original pattern.
/// ```
/// # use self::proxmox_backup::pxar::{MatchPattern, MatchPatternSlice, MatchType};
/// # fn main() -> Result<(), failure::Error> {
/// # fn main() -> Result<(), anyhow::Error> {
/// let pattern = MatchPattern::from_line(b"some/match/pattern/")?.unwrap();
/// let slice = pattern.as_slice();
/// let front = slice.get_front_pattern();
@ -246,7 +246,7 @@ impl<'a> MatchPatternSlice<'a> {
/// If no slash is encountered, the `MatchPatternSlice` will be empty.
/// ```
/// # use self::proxmox_backup::pxar::{MatchPattern, MatchPatternSlice, MatchType};
/// # fn main() -> Result<(), failure::Error> {
/// # fn main() -> Result<(), anyhow::Error> {
/// let pattern = MatchPattern::from_line(b"some/match/pattern/")?.unwrap();
/// let slice = pattern.as_slice();
/// let rest = slice.get_rest_pattern();
@ -379,7 +379,7 @@ impl<'a> MatchPatternSlice<'a> {
/// ```
/// # use std::ffi::CString;
/// # use self::proxmox_backup::pxar::{MatchPattern, MatchPatternSlice, MatchType};
/// # fn main() -> Result<(), failure::Error> {
/// # fn main() -> Result<(), anyhow::Error> {
/// let patterns = vec![
/// MatchPattern::from_line(b"some/match/pattern/")?.unwrap(),
/// MatchPattern::from_line(b"to_match/")?.unwrap()
@ -454,7 +454,7 @@ impl<'a> MatchPatternSlice<'a> {
/// ```
/// # use std::ffi::CString;
/// # use self::proxmox_backup::pxar::{MatchPattern, MatchPatternSlice, MatchType};
/// # fn main() -> Result<(), failure::Error> {
/// # fn main() -> Result<(), anyhow::Error> {
/// let patterns = vec![
/// MatchPattern::from_line(b"some/match/pattern/")?.unwrap(),
/// MatchPattern::from_line(b"to_match/")?.unwrap()

View File

@ -11,7 +11,7 @@ use std::os::unix::io::RawFd;
use std::path::{Path, PathBuf};
use endian_trait::Endian;
use failure::{bail, format_err, Error};
use anyhow::{bail, format_err, Error};
use nix::errno::Errno;
use nix::fcntl::OFlag;
use nix::sys::stat::Mode;