mirror of
https://github.com/haraldh/chainerror.git
synced 2025-01-30 16:46:42 +01:00
chore: remove more Chain..
occurences
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
parent
cacfb37d44
commit
cb2e1509e5
12
src/lib.rs
12
src/lib.rs
|
@ -111,9 +111,9 @@ impl<T: 'static + Display + Debug> Error<T> {
|
|||
/// # derive_str_context!(FooError);
|
||||
/// # let err = ChainError::new(String::new(), None, None);
|
||||
/// // Instead of writing
|
||||
/// err.find_cause::<ChainError<FooError>>();
|
||||
/// err.find_cause::<chainerror::Error<FooError>>();
|
||||
///
|
||||
/// // leave out the ChainError<FooError> implementation detail
|
||||
/// // leave out the chainerror::Error<FooError> implementation detail
|
||||
/// err.find_chain_cause::<FooError>();
|
||||
/// ```
|
||||
#[inline]
|
||||
|
@ -134,13 +134,13 @@ impl<T: 'static + Display + Debug> Error<T> {
|
|||
/// # derive_str_context!(FooErrorKind);
|
||||
/// # let err = ChainError::new(String::new(), None, None);
|
||||
/// // Instead of writing
|
||||
/// err.find_cause::<ChainError<FooErrorKind>>();
|
||||
/// err.find_cause::<chainerror::Error<FooErrorKind>>();
|
||||
/// // and/or
|
||||
/// err.find_chain_cause::<FooErrorKind>();
|
||||
/// // and/or
|
||||
/// err.find_cause::<FooErrorKind>();
|
||||
///
|
||||
/// // leave out the ChainError<FooErrorKind> implementation detail
|
||||
/// // leave out the chainerror::Error<FooErrorKind> implementation detail
|
||||
/// err.find_kind_or_cause::<FooErrorKind>();
|
||||
/// ```
|
||||
#[inline]
|
||||
|
@ -192,7 +192,7 @@ impl<T: 'static + Display + Debug> Error<T> {
|
|||
/// # }
|
||||
/// # }
|
||||
///
|
||||
/// fn func1() -> ChainResult<(), Func1ErrorKind> {
|
||||
/// fn func1() -> chainerror::Result<(), Func1ErrorKind> {
|
||||
/// func2().context(Func1ErrorKind::Func2)?;
|
||||
/// do_some_io().context(Func1ErrorKind::IO("bar.txt".into()))?;
|
||||
/// Ok(())
|
||||
|
@ -559,7 +559,7 @@ where
|
|||
/// # }
|
||||
/// derive_str_context!(Func2Error);
|
||||
///
|
||||
/// fn func2() -> ChainResult<(), Func2Error> {
|
||||
/// fn func2() -> chainerror::Result<(), Func2Error> {
|
||||
/// let filename = "foo.txt";
|
||||
/// do_some_io().context(Func2Error(format!("Error reading '{}'", filename)))?;
|
||||
/// Ok(())
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use chainerror::prelude::v1::*;
|
||||
use chainerror::ResultTrait;
|
||||
|
||||
#[test]
|
||||
fn test_basic() {
|
||||
|
@ -19,7 +19,6 @@ fn test_basic() {
|
|||
|
||||
if let Err(e) = process_config_file() {
|
||||
let os_notfound_error = std::io::Error::from_raw_os_error(2);
|
||||
eprintln!("Error:\n{:?}", e);
|
||||
let s = format!("{:?}", e);
|
||||
let lines = s.lines().collect::<Vec<_>>();
|
||||
assert_eq!(lines.len(), 5);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use chainerror::prelude::v1::*;
|
||||
use chainerror::ResultTrait;
|
||||
use std::error::Error;
|
||||
use std::io;
|
||||
|
||||
|
|
Loading…
Reference in a new issue