Skip to content

Commit 919dac8

Browse files
committed
misc: clippy fixes
1 parent a502601 commit 919dac8

File tree

15 files changed

+19
-18
lines changed

15 files changed

+19
-18
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ redundant_guards = "allow" # Currently broken for some cases, might enabl
7070
into_iter_without_iter = "allow" # This is only going to fire on some internal types, doesn't matter much
7171
struct_excessive_bools = "allow" # I have yet to find one case of this being useful
7272
needless_continue = "allow" # All occurences of this lint are just for clarity in large loops
73+
unbuffered_bytes = "allow" # It is up to the caller to wrap their data in `BufReader`s
7374

7475
[workspace.lints.rustdoc]
7576
broken_intra_doc_links = "deny"

lofty/src/ape/properties.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ where
191191
properties.bit_depth = 24
192192
} else {
193193
properties.bit_depth = 16
194-
};
194+
}
195195

196196
let blocks_per_frame = match version {
197197
_ if version >= 3950 => 73728 * 4,

lofty/src/ape/tag/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl ApeTag {
183183
self.insert(item);
184184
}
185185
},
186-
};
186+
}
187187
}
188188

189189
fn split_num_pair(&self, key: &str) -> (Option<u32>, Option<u32>) {

lofty/src/ape/tag/write.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ where
118118
)?;
119119
} else {
120120
tag = create_ape_tag(tag_ref, std::iter::empty(), write_options)?;
121-
};
121+
}
122122

123123
file.rewind()?;
124124

lofty/src/id3/v2/frame/conversion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl<'a> TryFrom<&'a TagItem> for FrameRef<'a> {
110110
)?);
111111
},
112112
(_, item_value) => value = frame_from_unknown_item(id, item_value.clone())?,
113-
};
113+
}
114114
},
115115
Err(_) => {
116116
let item_key = tag_item.key();

lofty/src/id3/v2/items/attached_picture_frame.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl AttachedPictureFrame<'_> {
9494
)?
9595
.text_or_none();
9696
mime_type = mime_type_str.map(|mime_type_str| MimeType::from_str(&mime_type_str));
97-
};
97+
}
9898

9999
let pic_type = PictureType::from_u8(reader.read_u8()?);
100100

@@ -168,7 +168,7 @@ impl AttachedPictureFrame<'_> {
168168
data.write_all(mime_type.as_str().as_bytes())?;
169169
}
170170
data.write_u8(0)?;
171-
};
171+
}
172172

173173
data.write_u8(self.picture.pic_type.as_u8())?;
174174

lofty/src/id3/v2/read.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ where
3636
tag_bytes = unsynchronized_reader.into_inner();
3737
} else {
3838
ret = read_all_frames_into_tag(&mut tag_bytes, header, parse_options)?;
39-
};
39+
}
4040

4141
// Throw away the rest of the tag (padding, bad frames)
4242
std::io::copy(&mut tag_bytes, &mut std::io::sink())?;

lofty/src/id3/v2/tag.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ impl Id3v2Tag {
544544
}
545545
}
546546
},
547-
};
547+
}
548548
}
549549

550550
/// Returns all genres contained in a `TCON` frame.
@@ -806,7 +806,7 @@ impl Accessor for Id3v2Tag {
806806

807807
if genres.peek().is_none() {
808808
return Some(Cow::Borrowed(first));
809-
};
809+
}
810810

811811
let mut joined = String::from(first);
812812
for genre in genres {

lofty/src/id3/v2/write/frame.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ where
154154
new_genre_string.push_str(genre);
155155
},
156156
_ => {
157-
new_genre_string.push_str(&format!("({genre})"));
157+
new_genre_string = format!("{new_genre_string}({genre})");
158158
},
159159
}
160160
}
@@ -197,7 +197,7 @@ where
197197
ipls_frame.value.push('\0');
198198
}
199199

200-
ipls_frame.value.push_str(&format!("{}\0{}", key, value));
200+
ipls_frame.value = format!("{}{key}\0{value}", ipls_frame.value);
201201
}
202202

203203
continue;

lofty/src/iff/aiff/read.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ where
163163
}
164164
} else {
165165
properties = AiffProperties::default();
166-
};
166+
}
167167

168168
Ok(AiffFile {
169169
properties,

lofty/src/iff/wav/properties.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ pub(super) fn read_properties(
210210
}) if valid_bits_per_sample > 0 => bit_depth = valid_bits_per_sample as u8,
211211
_ if bits_per_sample > 0 => bit_depth = bits_per_sample as u8,
212212
_ => bit_depth = bytes_per_sample.saturating_mul(8) as u8,
213-
};
213+
}
214214

215215
let channel_mask = extensible_info.map(|info| info.channel_mask);
216216

@@ -252,7 +252,7 @@ pub(super) fn read_properties(
252252
}
253253
} else {
254254
log::warn!("Unable to calculate duration and bitrate");
255-
};
255+
}
256256

257257
Ok(WavProperties {
258258
format: match format_tag {

lofty/src/mp4/ilst/write.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ where
683683
AtomData::UnsignedInteger(uint) => write_unsigned_int(*uint, writer)?,
684684
AtomData::Bool(b) => write_bool(*b, writer)?,
685685
AtomData::Unknown { code, data } => write_data(*code, data, writer)?,
686-
};
686+
}
687687
}
688688

689689
Ok(())

lofty/src/ogg/read.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ where
7373
Err(_) => decode_err!(@BAIL "OGG: File has an invalid vendor string"),
7474
}
7575
},
76-
};
76+
}
7777

7878
let number_of_items = data.read_u32::<LittleEndian>()?;
7979
if number_of_items > (len >> 2) as u32 {

lofty/src/picture.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ impl Picture {
489489
///
490490
/// * This is for reading picture data only, from a [`File`](std::fs::File) for example.
491491
/// * `pic_type` will always be [`PictureType::Other`], be sure to change it accordingly if
492-
/// writing.
492+
/// writing.
493493
///
494494
/// # Errors
495495
///

ogg_pager/src/packets.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ impl Packets {
153153
byte_count_to_read = packet_size;
154154
*packet_bytes_already_read = Some(packet_size);
155155
},
156-
};
156+
}
157157

158158
byte_count_to_read
159159
}

0 commit comments

Comments
 (0)