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
Clippy: Fixed some clippy warnings #31818
Changes from 3 commits
881a2cd
65e0a0c
65ddeaf
26b1327
4aadeb8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,10 +92,10 @@ impl VirtualMethods for HTMLFontElement { | |
} | ||
|
||
fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue { | ||
match name { | ||
&local_name!("face") => AttrValue::from_atomic(value.into()), | ||
&local_name!("color") => AttrValue::from_legacy_color(value.into()), | ||
&local_name!("size") => parse_size(&value), | ||
match *name { | ||
local_name!("face") => AttrValue::from_atomic(value.into()), | ||
local_name!("color") => AttrValue::from_legacy_color(value.into()), | ||
local_name!("size") => parse_size(&value), | ||
_ => self | ||
.super_type() | ||
.unwrap() | ||
|
@@ -174,8 +174,8 @@ fn parse_size(mut input: &str) -> AttrValue { | |
|
||
// Step 9 | ||
match parse_mode { | ||
ParseMode::RelativePlus => value = 3 + value, | ||
ParseMode::RelativeMinus => value = 3 - value, | ||
ParseMode::RelativePlus => value += 3, | ||
ParseMode::RelativeMinus => value -= 3, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since subtraction is not commutative, this change is not equivalent to the original code i.e I think we can simply revert the change on line 178 alone. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have reverted the changes, it should be fine now. |
||
ParseMode::Absolute => (), | ||
} | ||
|
||
|
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.
This function is now redundant, as it is not doing any actual work itself and simply forwards the call to the standard library method. So, we can just delete this function definition from this file and simply call
.is_ascii_lowercase()
wherever the deleted function is used. Please refer to my previous comment for an example of what needs to be done at the call site.Similar refactoring needs to done for
is_ascii_uppercase
as well.