Remove allow(pedantic) from formatter#6549
Conversation
|
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
d88c086 to
01d0c1d
Compare
01d0c1d to
008773a
Compare
PR Check ResultsEcosystem✅ ecosystem check detected no changes. BenchmarkLinuxWindows |
7f83eeb to
055af52
Compare
008773a to
70c5ff5
Compare
055af52 to
8eb36fa
Compare
70c5ff5 to
206b837
Compare
206b837 to
301fe5c
Compare
| } | ||
|
|
||
| /// Formats the value stored by this argument using the given formatter. | ||
| #[allow(clippy::inline_always)] |
There was a problem hiding this comment.
The docs says (https://rust-lang.github.io/rust-clippy/v0.0.212/index.html#inline_always):
While there are valid uses of this annotation (and once you know when to use it, by all means allow this lint), it’s a common newbie-mistake to pepper one’s code with it. As a rule of thumb, before slapping #[inline(always)] on a function, measure if that additional function call really affects your runtime profile sufficiently to make up for the increase in compile time.
Do we have measurements that #[inline(always)] is better than #[inline]?
| panic!( | ||
| "Tried to unwrap snapshot of type {:?} as {:?}", | ||
| err.type_id(), | ||
| (*err).type_id(), |
There was a problem hiding this comment.
Do you know which rule triggered here?
There was a problem hiding this comment.
I think it was calling type_id on Box<dyn >

Summary
This PR removes the module level
allow(pedantic)from theruff_formattercrate and fixes (or allows) the clippy violations.Why didn't we do this already? Computing the length of the input string required traversing the whole CST (nodes + tokens + trivia) in Rome. This by itself is much more expensive than resizing the buffer.
Test Plan
cargo test