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

@ -19,7 +19,7 @@ bytes = "0.5"
chrono = "0.4" # Date and time library for Rust chrono = "0.4" # Date and time library for Rust
crc32fast = "1" crc32fast = "1"
endian_trait = { version = "0.6", features = ["arrays"] } endian_trait = { version = "0.6", features = ["arrays"] }
failure = "0.1" anyhow = "1.0"
futures = "0.3" futures = "0.3"
h2 = { version = "0.2", features = ["stream"] } h2 = { version = "0.2", features = ["stream"] }
http = "0.2" http = "0.2"
@ -34,7 +34,7 @@ pam = "0.7"
pam-sys = "0.5" pam-sys = "0.5"
percent-encoding = "2.1" percent-encoding = "2.1"
pin-utils = "0.1.0-alpha" pin-utils = "0.1.0-alpha"
proxmox = { version = "0.1.21", features = [ "sortable-macro", "api-macro" ] } proxmox = { version = "0.1.22", features = [ "sortable-macro", "api-macro" ] }
#proxmox = { git = "ssh://gitolite3@proxdev.maurer-it.com/rust/proxmox", version = "0.1.2", features = [ "sortable-macro", "api-macro" ] } #proxmox = { git = "ssh://gitolite3@proxdev.maurer-it.com/rust/proxmox", version = "0.1.2", features = [ "sortable-macro", "api-macro" ] }
#proxmox = { path = "../proxmox/proxmox", features = [ "sortable-macro", "api-macro" ] } #proxmox = { path = "../proxmox/proxmox", features = [ "sortable-macro", "api-macro" ] }
regex = "1.2" regex = "1.2"

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, format_err, Error};
use serde_json::{json, Value}; use serde_json::{json, Value};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, Error};
use ::serde::{Deserialize, Serialize}; use ::serde::{Deserialize, Serialize};
use proxmox::api::{api, Router, RpcEnvironment, Permission}; use proxmox::api::{api, Router, RpcEnvironment, Permission};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use serde_json::{json, Value}; use serde_json::{json, Value};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::Error;
use serde_json::{json, Value}; use serde_json::{json, Value};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, Error};
use serde_json::Value; use serde_json::Value;
use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission}; use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission};

View File

@ -2,7 +2,7 @@ use std::collections::{HashSet, HashMap};
use std::convert::TryFrom; use std::convert::TryFrom;
use chrono::{TimeZone, Local}; use chrono::{TimeZone, Local};
use failure::*; use anyhow::{bail, Error};
use futures::*; use futures::*;
use hyper::http::request::Parts; use hyper::http::request::Parts;
use hyper::{header, Body, Response, StatusCode}; use hyper::{header, Body, Response, StatusCode};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, format_err, Error};
use futures::*; use futures::*;
use hyper::header::{HeaderValue, UPGRADE}; use hyper::header::{HeaderValue, UPGRADE};
use hyper::http::request::Parts; use hyper::http::request::Parts;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, Error};
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use std::collections::HashMap; use std::collections::HashMap;

View File

@ -2,7 +2,7 @@ use std::pin::Pin;
use std::sync::Arc; use std::sync::Arc;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use failure::*; use anyhow::{bail, format_err, Error};
use futures::*; use futures::*;
use hyper::Body; use hyper::Body;
use hyper::http::request::Parts; use hyper::http::request::Parts;

View File

@ -1,6 +1,6 @@
use std::path::PathBuf; use std::path::PathBuf;
use failure::*; use anyhow::{bail, Error};
use serde_json::Value; use serde_json::Value;
use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission}; use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, Error};
use serde_json::Value; use serde_json::Value;
use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission}; use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission};

View File

@ -1,6 +1,6 @@
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use failure::*; use anyhow::{Error};
use lazy_static::lazy_static; use lazy_static::lazy_static;
use openssl::sha; use openssl::sha;
use regex::Regex; use regex::Regex;

View File

@ -1,6 +1,6 @@
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
use failure::*; use anyhow::{Error};
use serde_json::{json, Value}; use serde_json::{json, Value};
use std::io::{BufRead,BufReader}; use std::io::{BufRead,BufReader};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use serde_json::{json, Value}; use serde_json::{json, Value};
use proxmox::api::{api, Router, Permission}; use proxmox::api::{api, Router, Permission};

View File

@ -1,6 +1,6 @@
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
use failure::*; use anyhow::{bail, Error};
use serde_json::{json, Value}; use serde_json::{json, Value};
use proxmox::{sortable, identity, list_subdirs_api_method}; use proxmox::{sortable, identity, list_subdirs_api_method};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use serde_json::{json, Value}; use serde_json::{json, Value};
use proxmox::sys::linux::procfs; use proxmox::sys::linux::procfs;

View File

@ -1,6 +1,6 @@
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
use failure::*; use anyhow::{Error};
use serde_json::{json, Value}; use serde_json::{json, Value};
use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission}; use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission};

View File

@ -1,7 +1,7 @@
use std::fs::File; use std::fs::File;
use std::io::{BufRead, BufReader}; use std::io::{BufRead, BufReader};
use failure::*; use anyhow::{Error};
use serde_json::{json, Value}; use serde_json::{json, Value};
use proxmox::api::{api, Router, RpcEnvironment, Permission}; use proxmox::api::{api, Router, RpcEnvironment, Permission};

View File

@ -1,7 +1,7 @@
use std::mem::{self, MaybeUninit}; use std::mem::{self, MaybeUninit};
use chrono::prelude::*; use chrono::prelude::*;
use failure::*; use anyhow::{bail, Error};
use serde_json::{json, Value}; use serde_json::{json, Value};
use proxmox::api::{api, Router, Permission}; use proxmox::api::{api, Router, Permission};

View File

@ -1,6 +1,6 @@
//! Sync datastore from remote server //! Sync datastore from remote server
use failure::*; use anyhow::{bail, format_err, Error};
use serde_json::json; use serde_json::json;
use std::convert::TryFrom; use std::convert::TryFrom;
use std::sync::Arc; use std::sync::Arc;

View File

@ -1,5 +1,5 @@
//use chrono::{Local, TimeZone}; //use chrono::{Local, TimeZone};
use failure::*; use anyhow::{bail, format_err, Error};
use futures::*; use futures::*;
use hyper::header::{self, HeaderValue, UPGRADE}; use hyper::header::{self, HeaderValue, UPGRADE};
use hyper::http::request::Parts; use hyper::http::request::Parts;

View File

@ -1,4 +1,4 @@
//use failure::*; //use anyhow::{bail, format_err, Error};
use std::sync::Arc; use std::sync::Arc;
use std::collections::HashMap; use std::collections::HashMap;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use serde_json::{json, Value}; use serde_json::{json, Value};
use proxmox::api::{api, Router, Permission}; use proxmox::api::{api, Router, Permission};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail};
use ::serde::{Deserialize, Serialize}; use ::serde::{Deserialize, Serialize};
use proxmox::api::{api, schema::*}; use proxmox::api::{api, schema::*};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use serde_json::{json, Value}; use serde_json::{json, Value};
use proxmox::api::{ApiHandler, ApiMethod, Router, RpcEnvironment, Permission}; use proxmox::api::{ApiHandler, ApiMethod, Router, RpcEnvironment, Permission};

View File

@ -7,7 +7,7 @@ use std::io::Write;
use std::ffi::{CString, CStr}; use std::ffi::{CString, CStr};
use base64; use base64;
use failure::*; use anyhow::{bail, format_err, Error};
use serde_json::json; use serde_json::json;
pub trait ProxmoxAuthenticator { pub trait ProxmoxAuthenticator {

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, format_err, Error};
use lazy_static::lazy_static; use lazy_static::lazy_static;
use openssl::rsa::{Rsa}; use openssl::rsa::{Rsa};

View File

@ -103,7 +103,7 @@
//! //!
//! Not sure if this is better. TODO //! Not sure if this is better. TODO
use failure::*; use anyhow::{bail, Error};
// Note: .pcat1 => Proxmox Catalog Format version 1 // Note: .pcat1 => Proxmox Catalog Format version 1
pub const CATALOG_NAME: &str = "catalog.pcat1.didx"; pub const CATALOG_NAME: &str = "catalog.pcat1.didx";

View File

@ -1,6 +1,6 @@
use crate::tools; use crate::tools;
use failure::*; use anyhow::{bail, format_err, Error};
use regex::Regex; use regex::Regex;
use std::os::unix::io::RawFd; use std::os::unix::io::RawFd;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, format_err, Error};
use std::fmt; use std::fmt;
use std::ffi::{CStr, CString, OsStr}; use std::ffi::{CStr, CString, OsStr};
use std::os::unix::ffi::OsStrExt; use std::os::unix::ffi::OsStrExt;

View File

@ -7,7 +7,7 @@ use std::os::unix::ffi::OsStrExt;
use std::path::{Component, Path, PathBuf}; use std::path::{Component, Path, PathBuf};
use chrono::{Utc, offset::TimeZone}; use chrono::{Utc, offset::TimeZone};
use failure::*; use anyhow::{bail, format_err, Error};
use nix::sys::stat::{Mode, SFlag}; use nix::sys::stat::{Mode, SFlag};
use proxmox::api::{cli::*, *}; use proxmox::api::{cli::*, *};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use std::sync::Arc; use std::sync::Arc;
use std::io::Read; use std::io::Read;

View File

@ -1,7 +1,7 @@
use std::sync::Arc; use std::sync::Arc;
use std::io::Write; use std::io::Write;
use failure::*; use anyhow::{Error};
use super::CryptConfig; use super::CryptConfig;
use crate::tools::borrow::Tied; use crate::tools::borrow::Tied;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, format_err, Error};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::io::Write; use std::io::Write;

View File

@ -2,7 +2,7 @@ use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use bytes::BytesMut; use bytes::BytesMut;
use failure::*; use anyhow::{Error};
use futures::ready; use futures::ready;
use futures::stream::{Stream, TryStream}; use futures::stream::{Stream, TryStream};

View File

@ -6,7 +6,7 @@
//! See the Wikipedia Artikel for [Authenticated //! See the Wikipedia Artikel for [Authenticated
//! encryption](https://en.wikipedia.org/wiki/Authenticated_encryption) //! encryption](https://en.wikipedia.org/wiki/Authenticated_encryption)
//! for a short introduction. //! for a short introduction.
use failure::*; use anyhow::{bail, Error};
use openssl::pkcs5::pbkdf2_hmac; use openssl::pkcs5::pbkdf2_hmac;
use openssl::hash::MessageDigest; use openssl::hash::MessageDigest;
use openssl::symm::{decrypt_aead, Cipher, Crypter, Mode}; use openssl::symm::{decrypt_aead, Cipher, Crypter, Mode};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, Error};
use std::sync::Arc; use std::sync::Arc;
use std::io::{Read, BufRead}; use std::io::{Read, BufRead};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use std::sync::Arc; use std::sync::Arc;
use std::io::Write; use std::io::Write;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, Error};
use std::convert::TryInto; use std::convert::TryInto;
use proxmox::tools::io::{ReadExt, WriteExt}; use proxmox::tools::io::{ReadExt, WriteExt};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, Error};
use std::sync::Arc; use std::sync::Arc;
use std::io::{Read, BufReader}; use std::io::{Read, BufReader};
use proxmox::tools::io::ReadExt; use proxmox::tools::io::ReadExt;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use std::sync::Arc; use std::sync::Arc;
use std::io::{Write, Seek, SeekFrom}; use std::io::{Write, Seek, SeekFrom};
use proxmox::tools::io::WriteExt; use proxmox::tools::io::WriteExt;

View File

@ -3,7 +3,7 @@ use std::io;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use failure::*; use anyhow::{bail, format_err, Error};
use lazy_static::lazy_static; use lazy_static::lazy_static;
use chrono::{DateTime, Utc}; use chrono::{DateTime, Utc};

View File

@ -5,7 +5,7 @@ use std::os::unix::io::AsRawFd;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::sync::Arc; use std::sync::Arc;
use failure::*; use anyhow::{bail, format_err, Error};
use proxmox::tools::io::ReadExt; use proxmox::tools::io::ReadExt;
use proxmox::tools::uuid::Uuid; use proxmox::tools::uuid::Uuid;
@ -275,7 +275,7 @@ struct ChunkCacher<'a, S> {
} }
impl<'a, S: ReadChunk> crate::tools::lru_cache::Cacher<usize, (u64, u64, Vec<u8>)> for ChunkCacher<'a, S> { impl<'a, S: ReadChunk> crate::tools::lru_cache::Cacher<usize, (u64, u64, Vec<u8>)> for ChunkCacher<'a, S> {
fn fetch(&mut self, index: usize) -> Result<Option<(u64, u64, Vec<u8>)>, failure::Error> { fn fetch(&mut self, index: usize) -> Result<Option<(u64, u64, Vec<u8>)>, anyhow::Error> {
let (start, end, digest) = self.index.chunk_info(index)?; let (start, end, digest) = self.index.chunk_info(index)?;
self.store.read_chunk(&digest).and_then(|data| Ok(Some((start, end, data)))) self.store.read_chunk(&digest).and_then(|data| Ok(Some((start, end, data))))
} }

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, format_err, Error};
use std::convert::TryInto; use std::convert::TryInto;
use std::io::{Seek, SeekFrom}; use std::io::{Seek, SeekFrom};

View File

@ -3,7 +3,7 @@ use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use bytes::{Bytes, BytesMut}; use bytes::{Bytes, BytesMut};
use failure::*; use anyhow::{format_err, Error};
use futures::*; use futures::*;
/// Trait to get digest list from index files /// Trait to get digest list from index files

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, format_err, Error};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use chrono::{Local, TimeZone, DateTime}; use chrono::{Local, TimeZone, DateTime};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, format_err, Error};
use std::convert::TryFrom; use std::convert::TryFrom;
use std::path::Path; use std::path::Path;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};
use std::path::PathBuf; use std::path::PathBuf;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use std::sync::Arc; use std::sync::Arc;
use super::datastore::*; use super::datastore::*;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
// chacha20-poly1305 // chacha20-poly1305

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use proxmox::api::{*, cli::*}; use proxmox::api::{*, cli::*};

View File

@ -1,6 +1,6 @@
use std::io::Write; use std::io::Write;
use failure::*; use anyhow::{Error};
use chrono::{DateTime, Utc}; use chrono::{DateTime, Utc};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use proxmox::api::format::*; use proxmox::api::format::*;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use proxmox::api::format::*; use proxmox::api::format::*;
use proxmox::api::cli::*; use proxmox::api::cli::*;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use proxmox::api::format::dump_api; use proxmox::api::format::dump_api;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, Error};
use std::thread; use std::thread;
use std::path::PathBuf; use std::path::PathBuf;

View File

@ -2,7 +2,7 @@ use std::future::Future;
use std::pin::Pin; use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use failure::*; use anyhow::{Error};
use futures::future::TryFutureExt; use futures::future::TryFutureExt;
use futures::stream::Stream; use futures::stream::Stream;
use tokio::net::TcpStream; use tokio::net::TcpStream;

View File

@ -2,7 +2,7 @@ use std::future::Future;
use std::pin::Pin; use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use failure::*; use anyhow::{format_err, Error};
use futures::future::TryFutureExt; use futures::future::TryFutureExt;
use futures::stream::Stream; use futures::stream::Stream;

View File

@ -1,6 +1,6 @@
use std::sync::Arc; use std::sync::Arc;
use failure::*; use anyhow::{format_err, Error};
use futures::*; use futures::*;
use hyper::{Request, Response, Body}; use hyper::{Request, Response, Body};
use openssl::ssl::{SslMethod, SslAcceptor, SslFiletype}; use openssl::ssl::{SslMethod, SslAcceptor, SslFiletype};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use futures::*; use futures::*;
// Simple H2 server to test H2 speed with h2client.rs // Simple H2 server to test H2 speed with h2client.rs

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, Error};
use futures::*; use futures::*;
use proxmox::try_block; use proxmox::try_block;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, format_err, Error};
use nix::unistd::{fork, ForkResult, pipe}; use nix::unistd::{fork, ForkResult, pipe};
use std::os::unix::io::RawFd; use std::os::unix::io::RawFd;
use chrono::{Local, DateTime, Utc, TimeZone}; use chrono::{Local, DateTime, Utc, TimeZone};

View File

@ -1,7 +1,7 @@
use std::path::PathBuf; use std::path::PathBuf;
use std::collections::HashMap; use std::collections::HashMap;
use failure::*; use anyhow::{bail, format_err, Error};
use serde_json::{json, Value}; use serde_json::{json, Value};
use proxmox::api::{api, cli::*, RpcEnvironment, ApiHandler}; use proxmox::api::{api, cli::*, RpcEnvironment, ApiHandler};

View File

@ -1,6 +1,6 @@
use std::sync::Arc; use std::sync::Arc;
use failure::*; use anyhow::{bail, format_err, Error};
use futures::*; use futures::*;
use hyper; use hyper;
use openssl::ssl::{SslMethod, SslAcceptor, SslFiletype}; use openssl::ssl::{SslMethod, SslAcceptor, SslFiletype};

View File

@ -1,6 +1,6 @@
extern crate proxmox_backup; extern crate proxmox_backup;
use failure::*; use anyhow::{format_err, Error};
use proxmox::{sortable, identity}; use proxmox::{sortable, identity};
use proxmox::api::{ApiHandler, ApiMethod, RpcEnvironment}; use proxmox::api::{ApiHandler, ApiMethod, RpcEnvironment};

View File

@ -2,7 +2,7 @@ extern crate proxmox_backup;
// also see https://www.johndcook.com/blog/standard_deviation/ // also see https://www.johndcook.com/blog/standard_deviation/
use failure::*; use anyhow::{Error};
use std::io::{Read, Write}; use std::io::{Read, Write};
use proxmox_backup::backup::*; use proxmox_backup::backup::*;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use futures::*; use futures::*;
extern crate proxmox_backup; extern crate proxmox_backup;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use proxmox_backup::client::*; use proxmox_backup::client::*;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{format_err, Error};
use std::io::{Read, Write, Seek, SeekFrom}; use std::io::{Read, Write, Seek, SeekFrom};
use std::fs::File; use std::fs::File;
use std::sync::Arc; use std::sync::Arc;

View File

@ -1,6 +1,6 @@
use std::fmt; use std::fmt;
use failure::*; use anyhow::{format_err, Error};
use proxmox::api::schema::*; use proxmox::api::schema::*;
use proxmox::const_regex; use proxmox::const_regex;

View File

@ -2,7 +2,7 @@ use std::collections::HashSet;
use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use failure::*; use anyhow::{format_err, Error};
use chrono::{DateTime, Utc}; use chrono::{DateTime, Utc};
use futures::*; use futures::*;
use futures::stream::Stream; use futures::stream::Stream;

View File

@ -3,7 +3,7 @@ use std::task::{Context, Poll};
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use chrono::Utc; use chrono::Utc;
use failure::*; use anyhow::{bail, format_err, Error};
use futures::*; use futures::*;
use http::Uri; use http::Uri;
use http::header::HeaderValue; use http::header::HeaderValue;

View File

@ -1,7 +1,7 @@
use std::pin::Pin; use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use failure::*; use anyhow::{Error};
use futures::*; use futures::*;
use crate::backup::ChunkInfo; use crate::backup::ChunkInfo;

View File

@ -6,7 +6,7 @@ use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use bytes::Bytes; use bytes::Bytes;
use failure::*; use anyhow::{format_err, Error};
use futures::{ready, Future}; use futures::{ready, Future};
use h2::SendStream; use h2::SendStream;

View File

@ -7,7 +7,7 @@ use std::sync::{Arc, Mutex};
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use std::thread; use std::thread;
use failure::*; use anyhow::{format_err, Error};
use futures::stream::Stream; use futures::stream::Stream;
use nix::fcntl::OFlag; use nix::fcntl::OFlag;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use std::thread; use std::thread;
use std::os::unix::io::FromRawFd; use std::os::unix::io::FromRawFd;

View File

@ -1,7 +1,7 @@
use std::collections::HashMap; use std::collections::HashMap;
use std::sync::Arc; use std::sync::Arc;
use failure::*; use anyhow::{Error};
use super::BackupReader; use super::BackupReader;
use crate::backup::{ReadChunk, DataBlob, CryptConfig}; use crate::backup::{ReadChunk, DataBlob, CryptConfig};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, Error};
use serde_json::json; use serde_json::json;
use super::HttpClient; use super::HttpClient;

View File

@ -3,7 +3,7 @@
//! This library contains helper to read, parse and write the //! This library contains helper to read, parse and write the
//! configuration files. //! configuration files.
use failure::*; use anyhow::{bail, format_err, Error};
use std::path::PathBuf; use std::path::PathBuf;
use nix::sys::stat::Mode; use nix::sys::stat::Mode;
use openssl::rsa::{Rsa}; use openssl::rsa::{Rsa};

View File

@ -3,7 +3,7 @@ use std::collections::{HashMap, HashSet, BTreeMap, BTreeSet};
use std::path::{PathBuf, Path}; use std::path::{PathBuf, Path};
use std::sync::{Arc, RwLock}; use std::sync::{Arc, RwLock};
use failure::*; use anyhow::{bail, Error};
use lazy_static::lazy_static; use lazy_static::lazy_static;
@ -520,7 +520,7 @@ pub fn save_config(acl: &AclTree) -> Result<(), Error> {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use failure::*; use anyhow::{Error};
use super::AclTree; use super::AclTree;
fn check_roles( fn check_roles(

View File

@ -2,7 +2,7 @@
use std::sync::Arc; use std::sync::Arc;
use failure::*; use anyhow::{Error};
use proxmox::api::section_config::SectionConfigData; use proxmox::api::section_config::SectionConfigData;
use proxmox::api::UserInformation; use proxmox::api::UserInformation;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, Error};
use lazy_static::lazy_static; use lazy_static::lazy_static;
use std::collections::HashMap; use std::collections::HashMap;
use serde::{Serialize, Deserialize}; use serde::{Serialize, Deserialize};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, Error};
use lazy_static::lazy_static; use lazy_static::lazy_static;
use std::collections::HashMap; use std::collections::HashMap;
use serde::{Serialize, Deserialize}; use serde::{Serialize, Deserialize};

View File

@ -1,7 +1,7 @@
use std::collections::HashMap; use std::collections::HashMap;
use std::sync::{Arc, RwLock}; use std::sync::{Arc, RwLock};
use failure::*; use anyhow::{bail, Error};
use lazy_static::lazy_static; use lazy_static::lazy_static;
use serde::{Serialize, Deserialize}; use serde::{Serialize, Deserialize};
use serde_json::json; use serde_json::json;

View File

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

View File

@ -8,7 +8,7 @@ use std::io::{Read, Seek, SeekFrom};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::os::unix::ffi::OsStrExt; use std::os::unix::ffi::OsStrExt;
use failure::*; use anyhow::{bail, format_err, Error};
use libc; use libc;
use super::binary_search_tree::search_binary_tree_by; 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::os::unix::io::{AsRawFd, RawFd};
use std::path::PathBuf; use std::path::PathBuf;
use failure::{format_err, Error}; use anyhow::{format_err, Error};
use nix::errno::Errno; use nix::errno::Errno;
use nix::fcntl::OFlag; use nix::fcntl::OFlag;
use nix::sys::stat::Mode; use nix::sys::stat::Mode;

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, format_err, Error};
use futures::*; use futures::*;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use serde_json::{json, Value}; use serde_json::{json, Value};
use hyper::{Body, Response, StatusCode}; use hyper::{Body, Response, StatusCode};

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use std::collections::HashMap; use std::collections::HashMap;
use std::sync::Arc; use std::sync::Arc;

View File

@ -6,7 +6,7 @@ use std::pin::Pin;
use std::sync::Arc; use std::sync::Arc;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use failure::*; use anyhow::{bail, format_err, Error};
use futures::future::{self, FutureExt, TryFutureExt}; use futures::future::{self, FutureExt, TryFutureExt};
use futures::stream::TryStreamExt; use futures::stream::TryStreamExt;
use hyper::header; use hyper::header;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{Error};
use lazy_static::lazy_static; use lazy_static::lazy_static;
use std::sync::Mutex; use std::sync::Mutex;

View File

@ -1,4 +1,4 @@
use failure::*; use anyhow::{bail, Error};
use lazy_static::lazy_static; use lazy_static::lazy_static;
use regex::Regex; use regex::Regex;
use chrono::Local; use chrono::Local;

View File

@ -6,7 +6,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use chrono::Local; use chrono::Local;
use failure::*; use anyhow::{bail, format_err, Error};
use futures::*; use futures::*;
use lazy_static::lazy_static; use lazy_static::lazy_static;
use nix::unistd::Pid; use nix::unistd::Pid;

Some files were not shown because too many files have changed in this diff Show More