diff --git a/lib/color-eyre b/lib/color-eyre index 55f8c6b..dc427b0 160000 --- a/lib/color-eyre +++ b/lib/color-eyre @@ -1 +1 @@ -Subproject commit 55f8c6b7481d462e50ee4a03a43253d80d648ae2 +Subproject commit dc427b06422ec01c4938e88c3aabaf7079332171 diff --git a/lib/nexusmods/src/lib.rs b/lib/nexusmods/src/lib.rs index 3dbbecd..c305db0 100644 --- a/lib/nexusmods/src/lib.rs +++ b/lib/nexusmods/src/lib.rs @@ -154,7 +154,7 @@ impl Api { self.mods_download_link(nxm.mod_id, nxm.file_id, nxm.key, nxm.expires) )?; - let Some(download_url) = download_info.get(0).map(|i| i.uri.clone()) else { + let Some(download_url) = download_info.first().map(|i| i.uri.clone()) else { return Err(Error::InvalidNXM("no download link", url)); }; diff --git a/lib/sdk/src/bundle/mod.rs b/lib/sdk/src/bundle/mod.rs index 96a2ec2..813df06 100644 --- a/lib/sdk/src/bundle/mod.rs +++ b/lib/sdk/src/bundle/mod.rs @@ -227,13 +227,10 @@ impl Bundle { let _enter = span.enter(); tracing::trace!(num_files = self.files.len()); - self.files - .iter() - .fold(Ok::, Report>(Vec::new()), |data, file| { - let mut data = data?; - data.append(&mut file.to_binary()?); - Ok(data) - })? + self.files.iter().try_fold(Vec::new(), |mut data, file| { + data.append(&mut file.to_binary()?); + Ok::<_, Report>(data) + })? }; // Ceiling division (or division toward infinity) to calculate diff --git a/lib/sdk/src/filetype/lua.rs b/lib/sdk/src/filetype/lua.rs index 3979b7a..8de212f 100644 --- a/lib/sdk/src/filetype/lua.rs +++ b/lib/sdk/src/filetype/lua.rs @@ -53,8 +53,8 @@ where let mut buf = vec![0u8; length]; r.read_exact(&mut buf)?; - let mut s = String::from_utf8(buf) - .wrap_err_with(|| format!("Invalid byte sequence for LuaJIT bytecode name"))?; + let mut s = + String::from_utf8(buf).wrap_err("Invalid byte sequence for LuaJIT bytecode name")?; // Remove the leading `@` s.remove(0); s