Apply clippy lints
This commit is contained in:
parent
192f942927
commit
7a325b0361
4 changed files with 8 additions and 11 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 55f8c6b7481d462e50ee4a03a43253d80d648ae2
|
||||
Subproject commit dc427b06422ec01c4938e88c3aabaf7079332171
|
|
@ -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));
|
||||
};
|
||||
|
||||
|
|
|
@ -227,12 +227,9 @@ impl Bundle {
|
|||
let _enter = span.enter();
|
||||
tracing::trace!(num_files = self.files.len());
|
||||
|
||||
self.files
|
||||
.iter()
|
||||
.fold(Ok::<Vec<u8>, Report>(Vec::new()), |data, file| {
|
||||
let mut data = data?;
|
||||
self.files.iter().try_fold(Vec::new(), |mut data, file| {
|
||||
data.append(&mut file.to_binary()?);
|
||||
Ok(data)
|
||||
Ok::<_, Report>(data)
|
||||
})?
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue