Skip to content

Commit d4ff370

Browse files
committed
fix: nightly clippy issues
1 parent dfd278d commit d4ff370

3 files changed

Lines changed: 4 additions & 8 deletions

File tree

updatehub/src/object/installer/test.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ use pkg_schema::objects;
1010
impl Installer for objects::Test {
1111
async fn check_requirements(&self, _: &Context) -> super::Result<()> {
1212
if self.force_check_requirements_fail {
13-
return Err(std::io::Error::new(
14-
std::io::ErrorKind::Other,
15-
"fail to check the requirements",
16-
)
17-
.into());
13+
return Err(std::io::Error::other("fail to check the requirements").into());
1814
}
1915
Ok(())
2016
}

updatehub/src/utils/delta.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ where
6060
R: bitar::archive_reader::ArchiveReader<Error = E1>,
6161
E2: From<E1>
6262
+ From<std::io::Error>
63-
+ From<bitar::HashSumMismatchError>
63+
+ From<Box<bitar::HashSumMismatchError>>
6464
+ From<bitar::CompressionError>,
6565
{
6666
// Open output file
@@ -98,7 +98,7 @@ where
9898
let compressed = result?;
9999
// read_archive_bytes += compressed.len();
100100
let unverified = compressed.decompress()?;
101-
let verified = unverified.verify()?;
101+
let verified = unverified.verify().map_err(|e| E2::from(Box::new(e)))?;
102102
output.feed(&verified).await?;
103103
}
104104

updatehub/src/utils/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub enum Error {
6363
#[display(fmt = "bita operation failed due to compression error: {}", _0)]
6464
BitaCompression(bitar::CompressionError),
6565
#[display(fmt = "bita operation failed due to hash sum mismatch error: {}", _0)]
66-
BitaHashSum(bitar::HashSumMismatchError),
66+
BitaHashSum(Box<bitar::HashSumMismatchError>),
6767
#[display(fmt = "bita operation failed due to invalid url: {}", _0)]
6868
BitaUrl(url::ParseError),
6969
}

0 commit comments

Comments
 (0)