Skip to content

Conversation

@Rudxain
Copy link

@Rudxain Rudxain commented Dec 15, 2025

Fixes this pitfall: rust-lang/rust-clippy#16213

Related: #9255

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@sylvestre
Copy link
Contributor

@Rudxain still draft after 2 weeks, are you going to work on it? thanks

@Rudxain
Copy link
Author

Rudxain commented Dec 27, 2025

are you going to work on it? thanks

Yes! This PR can be merged as-is, but I want to replace from_str_radix by some internal utility. I could simply write an ad-hoc hex-parser, but I assume there's already one, so it's better to reuse the code. The closest I could find was this:

/// Return the digit value of a character in the given base
fn digit(&self, c: char) -> Option<u64> {
fn from_decimal(c: char) -> u64 {
u64::from(c) - u64::from('0')
}
match self {
Self::Binary => ('0'..='1').contains(&c).then(|| from_decimal(c)),
Self::Octal => ('0'..='7').contains(&c).then(|| from_decimal(c)),
Self::Decimal => c.is_ascii_digit().then(|| from_decimal(c)),
Self::Hexadecimal => match c.to_ascii_lowercase() {
'0'..='9' => Some(from_decimal(c)),
c @ 'a'..='f' => Some(u64::from(c) - u64::from('a') + 10),
_ => None,
},
}
}

Should I use that? Or is there something more appropriate?

@Rudxain Rudxain force-pushed the stty-fix-hex branch 3 times, most recently from 641efd8 to 4e269cf Compare December 29, 2025 20:32
@Rudxain
Copy link
Author

Rudxain commented Dec 29, 2025

I didn't expect the workflow queue to be cancelled 😕

@sylvestre
Copy link
Contributor

Restarted

@Rudxain

This comment was marked as resolved.

@Rudxain Rudxain marked this pull request as ready for review February 3, 2026 20:02
@Rudxain
Copy link
Author

Rudxain commented Feb 3, 2026

BTW, this branch is soft-blocked on this PR. Should I include that patch into this PR, or should I keep it separate for better scoping?

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants