Skip to content
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: Fix unnecessary_lazy_evaluations warnings in components #31898

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/gfx/platform/windows/font.rs
Expand Up @@ -237,7 +237,7 @@ impl FontHandleMethods for FontHandle {
None => {
let bytes = template.bytes();
let font_file =
FontFile::new_from_data(bytes).ok_or_else(|| "Could not create FontFile")?;
FontFile::new_from_data(bytes).ok_or("Could not create FontFile")?;
let face = font_file
.create_face(0, dwrote::DWRITE_FONT_SIMULATIONS_NONE)
.map_err(|_| "Could not create FontFace")?;
Expand Down
8 changes: 2 additions & 6 deletions components/script/dom/mediafragmentparser.rs
Expand Up @@ -300,11 +300,7 @@ fn parse_hms(s: &str) -> Result<f64, ()> {

let result = match vec.len() {
1 => {
let secs = vec
.pop_front()
.ok_or_else(|| ())?
.parse::<f64>()
.map_err(|_| ())?;
let secs = vec.pop_front().ok_or(())?.parse::<f64>().map_err(|_| ())?;

if secs == 0. {
return Err(());
Expand All @@ -318,7 +314,7 @@ fn parse_hms(s: &str) -> Result<f64, ()> {
parse_npt_seconds(vec.pop_front().ok_or(())?)?,
),
3 => hms_to_seconds(
vec.pop_front().ok_or_else(|| ())?.parse().map_err(|_| ())?,
vec.pop_front().ok_or(())?.parse().map_err(|_| ())?,
parse_npt_minute(vec.pop_front().ok_or(())?)?,
parse_npt_seconds(vec.pop_front().ok_or(())?)?,
),
Expand Down