-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
usage of cargo clippy --fix --lib -p usvg
with rust 1.83.0
#876
base: main
Are you sure you want to change the base?
Conversation
f07d790
to
f943fe3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of these changes are at best marginal
clip_path = convert(link, state, object_bbox, cache); | ||
|
||
// Linked `clipPath` must be valid. | ||
if clip_path.is_none() { | ||
return None; | ||
} | ||
clip_path.as_ref()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is better. If you do want to change this, I'd say:
// Bail out if the linked clip path is invalid
let clip_path_attr = convert(...)?;
clip_path = Some(clip_path_attr);
But I think the original code is fine...
@@ -331,7 +331,7 @@ fn convert_stops(grad: SvgNode) -> Vec<Stop> { | |||
if stops.len() >= 3 { | |||
let mut i = 0; | |||
while i < stops.len() - 2 { | |||
let offset1 = stops[i + 0].offset.get(); | |||
let offset1 = stops[i].offset.get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again... I can see the rationale, but I think the previous version was probably better.
@@ -1418,7 +1418,7 @@ fn shape_text_with_font( | |||
|
|||
glyphs.push(Glyph { | |||
byte_idx: ByteIndex::new(idx), | |||
cluster_len: end.checked_sub(start).unwrap_or(0), // TODO: can fail? | |||
cluster_len: end.saturating_sub(start), // TODO: can fail? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The semantics are the same, but the meaning this suggests to the reader is different
My understanding was that all of these are changes automatically applied by clippy, no? 😄 In which case we probably would have to adapt which lints we want to have. |
Pull requests that include: