Skip to content

Commit 9571b69

Browse files
committed
misc: Bump MSRV to 1.89.0
1 parent 5497a02 commit 9571b69

22 files changed

Lines changed: 138 additions & 128 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ env:
1616
CARGO_TERM_COLOR: always
1717

1818
jobs:
19+
build_msrv:
20+
name: Build MSRV
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v6
24+
- name: Install Rust toolchain
25+
uses: dtolnay/rust-toolchain@v1
26+
with:
27+
toolchain: 1.89.0
28+
- run: |
29+
cargo build --all-features --workspace --tests --examples
30+
1931
test:
2032
name: Tests
2133
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
### Changed
1010

1111
- **MP4**: `Mp4File::ftyp()` was moved to `Mp4Properties::ftyp()` ([PR](https://github.com/Serial-ATA/lofty-rs/pull/650))
12+
- **MSRV**: Bumped to **1.89.0** ([PR](https://github.com/Serial-ATA/lofty-rs/pull/652))
1213

1314
### Fixed
1415

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ members = [
1111

1212
[workspace.package]
1313
edition = "2024"
14-
rust-version = "1.85"
14+
rust-version = "1.89"
1515
repository = "https://github.com/Serial-ATA/lofty-rs"
1616
license = "MIT OR Apache-2.0"
1717

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/Serial-ATA/lofty-rs/ci.yml?branch=main&logo=github&style=for-the-badge)](https://github.com/Serial-ATA/lofty-rs/actions/workflows/ci.yml)
88
[![Downloads](https://img.shields.io/crates/d/lofty?style=for-the-badge&logo=rust)](https://crates.io/crates/lofty)
99
[![Version](https://img.shields.io/crates/v/lofty?style=for-the-badge&logo=rust)](https://crates.io/crates/lofty)
10-
[![MSRV](https://img.shields.io/crates/msrv/lofty?style=for-the-badge&color=lightgray)](https://blog.rust-lang.org/2025/02/20/Rust-1.85.0/)
10+
[![MSRV](https://img.shields.io/crates/msrv/lofty?style=for-the-badge&color=lightgray)](https://blog.rust-lang.org/2025/08/07/Rust-1.89.0/)
1111
[![Documentation](https://img.shields.io/badge/docs.rs-lofty-informational?style=for-the-badge&logo=read-the-docs)](https://docs.rs/lofty/)
1212
[![GitHub Sponsors](https://img.shields.io/github/sponsors/Serial-ATA?style=for-the-badge&logo=githubsponsors)](https://github.com/sponsors/Serial-ATA)
1313

lofty/src/ape/tag/mod.rs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -568,19 +568,19 @@ impl SplitTag for ApeTag {
568568
let item = std::mem::replace(item, ApeItem::EMPTY);
569569

570570
// Multi-value string
571-
if let Some(text) = item.value.text() {
572-
if text.contains('\0') {
573-
for value in text.split('\0') {
574-
let item_value = match &item.value {
575-
ItemValue::Text(_) => ItemValue::Text(value.to_string()),
576-
ItemValue::Locator(_) => ItemValue::Locator(value.to_string()),
577-
_ => unreachable!(),
578-
};
579-
580-
tag.items.push(TagItem::new(k, item_value))
581-
}
582-
return false; // Item consumed
571+
if let Some(text) = item.value.text()
572+
&& text.contains('\0')
573+
{
574+
for value in text.split('\0') {
575+
let item_value = match &item.value {
576+
ItemValue::Text(_) => ItemValue::Text(value.to_string()),
577+
ItemValue::Locator(_) => ItemValue::Locator(value.to_string()),
578+
_ => unreachable!(),
579+
};
580+
581+
tag.items.push(TagItem::new(k, item_value))
583582
}
583+
return false; // Item consumed
584584
}
585585

586586
tag.items.push(TagItem::new(k, item.value));
@@ -604,12 +604,11 @@ impl MergeTag for SplitTagRemainder {
604604
}
605605

606606
for pic in tag.pictures {
607-
if let Some(key) = pic.pic_type.as_ape_key() {
608-
if let Ok(item) =
607+
if let Some(key) = pic.pic_type.as_ape_key()
608+
&& let Ok(item) =
609609
ApeItem::new(key.to_string(), ItemValue::Binary(pic.as_ape_bytes()))
610-
{
611-
merged.insert(item)
612-
}
610+
{
611+
merged.insert(item)
613612
}
614613
}
615614

lofty/src/file/file_type.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,14 @@ impl FileType {
188188
let ext = ext.as_ref().to_str()?.to_ascii_lowercase();
189189

190190
// Give custom resolvers priority
191-
if unsafe { global_options().use_custom_resolvers } {
192-
if let Some((ty, _)) = CUSTOM_RESOLVERS
191+
if unsafe { global_options().use_custom_resolvers }
192+
&& let Some((ty, _)) = CUSTOM_RESOLVERS
193193
.lock()
194194
.ok()?
195195
.iter()
196196
.find(|(_, f)| f.extension() == Some(ext.as_str()))
197-
{
198-
return Some(Self::Custom(ty));
199-
}
197+
{
198+
return Some(Self::Custom(ty));
200199
}
201200

202201
// Also update `EXTENSIONS` above

lofty/src/flac/write.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,14 @@ where
140140

141141
blocks.extend(metadata_blocks);
142142

143-
if will_write_padding {
144-
if let Some(preferred_padding) = write_options.preferred_padding {
145-
log::warn!("File is missing a PADDING block. Adding one");
143+
if will_write_padding && let Some(preferred_padding) = write_options.preferred_padding {
144+
log::warn!("File is missing a PADDING block. Adding one");
146145

147-
// `PADDING` always goes last
148-
let mut padding_block = Block::new_padding(preferred_padding as usize)?;
149-
padding_block.last = true;
146+
// `PADDING` always goes last
147+
let mut padding_block = Block::new_padding(preferred_padding as usize)?;
148+
padding_block.last = true;
150149

151-
blocks.push(padding_block);
152-
}
150+
blocks.push(padding_block);
153151
}
154152

155153
if let Some(block) = blocks.last_mut() {

lofty/src/id3/v1/tag.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,10 @@ impl SplitTag for Id3v1Tag {
326326
))
327327
}
328328

329-
if let Some(genre_index) = self.genre.take() {
330-
if let Some(genre) = GENRES.get(genre_index as usize) {
331-
tag.insert_text(ItemKey::Genre, (*genre).to_string());
332-
}
329+
if let Some(genre_index) = self.genre.take()
330+
&& let Some(genre) = GENRES.get(genre_index as usize)
331+
{
332+
tag.insert_text(ItemKey::Genre, (*genre).to_string());
333333
}
334334

335335
(SplitTagRemainder, tag)

lofty/src/id3/v2/frame/header/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,11 @@ impl TryFrom<ItemKey> for FrameId<'_> {
197197
type Error = LoftyError;
198198

199199
fn try_from(value: ItemKey) -> std::prelude::rust_2015::Result<Self, Self::Error> {
200-
if let Some(mapped) = value.map_key(TagType::Id3v2) {
201-
if mapped.len() == 4 {
202-
Self::verify_id(mapped)?;
203-
return Ok(Self::Valid(Cow::Borrowed(mapped)));
204-
}
200+
if let Some(mapped) = value.map_key(TagType::Id3v2)
201+
&& mapped.len() == 4
202+
{
203+
Self::verify_id(mapped)?;
204+
return Ok(Self::Valid(Cow::Borrowed(mapped)));
205205
}
206206

207207
Err(Id3v2Error::new(Id3v2ErrorKind::UnsupportedFrameId(value)).into())

lofty/src/id3/v2/tag.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,10 +1302,10 @@ impl From<Id3v2Tag> for Tag {
13021302

13031303
impl From<Tag> for Id3v2Tag {
13041304
fn from(mut input: Tag) -> Self {
1305-
if unsafe { global_options().preserve_format_specific_items } {
1306-
if let Some(companion) = input.companion_tag.take().and_then(CompanionTag::id3v2) {
1307-
return SplitTagRemainder(companion).merge_tag(input);
1308-
}
1305+
if unsafe { global_options().preserve_format_specific_items }
1306+
&& let Some(companion) = input.companion_tag.take().and_then(CompanionTag::id3v2)
1307+
{
1308+
return SplitTagRemainder(companion).merge_tag(input);
13091309
}
13101310

13111311
SplitTagRemainder::default().merge_tag(input)

0 commit comments

Comments
 (0)