Skip to content

Conversation

@danieleades
Copy link

addresses some clippy warnings (including some pedantic ones)

i see there's a commented out clippy linting job- does that mean there's an ambition to sort out the warnings and enable linting?

Copy link
Member

@martin-g martin-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

return;
} else if self.capacity() == 0 {
}
if self.capacity() == 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this also suggested by Clippy ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this also suggested by Clippy ?

It is

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't care about what clippy thinks. This makes the function more confusing to read, and it's probably one of the pedantic lints anyway.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a pedantic lint and i'd be happy to revert in this case.

i've not enforced pedantic lints in #814

@martin-g
Copy link
Member

martin-g commented Jan 4, 2026

i see there's a commented out clippy linting job- does that mean there's an ambition to sort out the warnings and enable linting?

This would be nice!

@danieleades
Copy link
Author

i see there's a commented out clippy linting job- does that mean there's an ambition to sort out the warnings and enable linting?

This would be nice!

I can take a look at that in a future PR

@danieleades
Copy link
Author

see #814

Comment on lines +1363 to +1368
assert!(!buf.try_reclaim(6));
buf.reserve(6);
assert_eq!(true, buf.try_reclaim(6));
assert!(buf.try_reclaim(6));
let cap = buf.capacity();
assert!(cap >= 6);
assert_eq!(false, buf.try_reclaim(cap + 1));
assert!(!buf.try_reclaim(cap + 1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are not helpful. It's perfectly readable as-is.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are default clippy lints, not pedantic lints, which means if you have clippy enabled in your IDE you get spammed with these warnings. This 'noise' can hide more impactful lints.

i don't have any strong feelings about this lint in particular, but i think it's useful for contributors to both-

  1. use clippy
  2. reduce the noise generated by clippy so the results are meaningful

there are two ways to reduce that noise. Either you can address the lints, or you can explicitly suppress them. I don't care which, but i think the status quo is an issue.

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.

3 participants