Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,15 @@ jobs:
uses: actions/checkout@v2
- name: Check formatting
run: cargo fmt -v -- --check
clippy:
name: Check clippy
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-Dwarnings"
steps:
- name: Get latest stable Rust
run: rustup toolchain install stable --profile default
- name: Check out source
uses: actions/checkout@v2
- name: Run clippy
run: cargo clippy
10 changes: 0 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,3 @@ jobs:
uses: actions/checkout@v2
- name: Run tests
run: cargo test --all
msrv:
name: Run tests on mininum supported rust version
runs-on: ubuntu-latest
steps:
- name: Get minimum supported Rust
run: rustup toolchain install 1.51.0 --profile minimal
- name: Check out source
uses: actions/checkout@v2
- name: Run tests
run: cargo test --all
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "mailparse"
version = "0.17.0"
authors = ["Kartikaya Gupta"]
edition = "2024"
rust-version = "1.85.0"
license = "0BSD"

description = "A simple parser for MIME e-mail messages"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ See the rustdoc at [docs.rs](https://docs.rs/mailparse/).

MSRV policy
---
Currently the minimum supported Rust version (MSRV) is 1.51.0.
Currently the minimum supported Rust version (MSRV) is 1.85.0.
MSRV increases will be kept to a minimum, and will always be accompanied with a minor version bump.

Contributing
Expand Down
2 changes: 1 addition & 1 deletion src/addrparse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ fn addrparse_inner(
// Technically not valid, but occurs in real-world corpus, so handle it gracefully
state = AddrParseState::Initial;
addr = None;
} else if c == ':' && !addr.as_ref().map_or(false, |s| s.contains('@')) {
} else if c == ':' && !addr.as_ref().is_some_and(|s| s.contains('@')) {
if in_group {
return Err(MailParseError::Generic(
"Found unexpected nested group",
Expand Down
3 changes: 0 additions & 3 deletions src/bytescan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
//! Uses the classic haszero/hasless bit tricks (Bit Twiddling Hacks) on usize
//! words loaded with from_le_bytes. No unsafe, no dependencies.

// clippy suggests as_chunks here, but that needs Rust 1.88.
#![allow(clippy::chunks_exact_to_as_chunks)]

const WORD: usize = core::mem::size_of::<usize>();
const LO: usize = usize::from_ne_bytes([0x01; WORD]);
const HI: usize = usize::from_ne_bytes([0x80; WORD]);
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ fn unescape(text: &str) -> String {
}
unescaped.push(c);
}
return unescaped;
unescaped
}

/// Parse parameterized header values such as that for Content-Type
Expand Down Expand Up @@ -1153,7 +1153,7 @@ fn parse_param_content(content: &str) -> ParamContent {
let mut pending_charset: Option<Charset> = None;
let mut index = 0;
loop {
let segment_key = format!("{}*{}", &base, index);
let segment_key = format!("{}*{}", base, index);
if let Some((octets, charset)) = octet_segments.remove(&segment_key) {
// Encoded segment: accumulate octets (all share the *0 charset).
pending_charset = Some(charset);
Expand Down
Loading