mirror of
https://github.com/haraldh/chainerror.git
synced 2025-05-29 21:18:07 +02:00
fix: clippy
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
parent
05085229be
commit
d60cdf9cdb
7 changed files with 14 additions and 13 deletions
|
@ -18,7 +18,7 @@ fn func3() -> Result<(), Box<dyn Error + Send + Sync>> {
|
|||
derive_str_context!(Func2Error);
|
||||
|
||||
fn func2() -> ChainResult<(), Func2Error> {
|
||||
func3().context(Func2Error(format!("func2 error: calling func3")))?;
|
||||
func3().context(Func2Error("func2 error: calling func3".to_string()))?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ pub mod mycrate {
|
|||
|
||||
let filename = "bar.txt";
|
||||
|
||||
do_some_io(filename).map_context(|e| ErrorKind::from_io_error(&e, filename.into()))?;
|
||||
do_some_io(filename).map_context(|e| ErrorKind::from_io_error(e, filename.into()))?;
|
||||
do_some_io(filename).map_context(|_| ErrorKind::IO(filename.into()))?;
|
||||
do_some_io(filename).map_context(|e| ErrorKind::from(e))?;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
|||
}
|
||||
|
||||
fn func1() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
func2().context(format!("func1 error"))?;
|
||||
func2().context("func1 error")?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ fn func2() -> Result<(), Box<dyn Error + Send + Sync>> {
|
|||
derive_str_context!(Func1Error);
|
||||
|
||||
fn func1() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
func2().context(Func1Error(format!("func1 error")))?;
|
||||
func2().context(Func1Error("func1 error".to_string()))?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ derive_str_context!(Func1ErrorFunc2);
|
|||
derive_str_context!(Func1ErrorIO);
|
||||
|
||||
fn func1() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
func2().context(Func1ErrorFunc2(format!("func1 error calling func2")))?;
|
||||
func2().context(Func1ErrorFunc2("func1 error calling func2".to_string()))?;
|
||||
let filename = "bar.txt";
|
||||
do_some_io().context(Func1ErrorIO(format!("Error reading '{}'", filename)))?;
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue