coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

Enable clippy::unwrap_used

Open oech3 opened this issue 6 months ago • 3 comments

I know it is very difficult to do that. But forcing on CI is useful more than guideline.

oech3 avatar May 21 '26 17:05 oech3

What would we do with those unwraps? Change them to expect(...) instead, or rather use match? Should we then annotate all tests with #[allow(clippy::unwrap_used)] so we at least not have to bother with adapting all the tests?

ksgk1 avatar May 24 '26 22:05 ksgk1

except() still cause panic!. So we should just remove unwrap(), or provide reason why does not panic with reason="".

I have no idea how to exclude test,build and fizz code from clippy...

oech3 avatar May 24 '26 22:05 oech3

#[cfg(test)]
mod test {
    #![allow(clippy::unwrap_used)]
    ...
}

Is something that can allow unwrap in tests, I would have to check if the same applies for build and fizz.

ksgk1 avatar May 24 '26 23:05 ksgk1