mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
clippy: Fix unnecessary_lazy_evaluations warnings (#31898)
This commit is contained in:
parent
65db6e3b08
commit
773e881971
2 changed files with 3 additions and 7 deletions
|
@ -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")?;
|
||||
|
|
|
@ -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(());
|
||||
|
@ -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(())?)?,
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue