fix: clippy

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
Harald Hoyer 2023-07-27 12:39:31 +02:00
parent 05085229be
commit d60cdf9cdb
Signed by: harald
GPG key ID: 900F3C4971086004
7 changed files with 14 additions and 13 deletions

View file

@ -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(())
}

View file

@ -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))?;

View file

@ -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(())
}

View file

@ -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(())
}

View file

@ -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(())