Skip to content

Commit 5a737e3

Browse files
committed
Placate newest Clippy
1 parent 4fd15a9 commit 5a737e3

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

  • crates/engine_spx2html/src

crates/engine_spx2html/src/lib.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -634,10 +634,7 @@ struct ElementState {
634634
impl ElementState {
635635
/// Should this element automatically be closed if a new tag starts or ends?
636636
fn is_auto_close(&self) -> bool {
637-
match self.origin {
638-
ElementOrigin::FontAuto => true,
639-
_ => false,
640-
}
637+
matches!(self.origin, ElementOrigin::FontAuto)
641638
}
642639
}
643640

@@ -824,7 +821,7 @@ impl EmittingState {
824821

825822
// If the x difference is larger than 1/4 of the space_width, let's say that
826823
// we need a space. I made up the 1/4.
827-
return 4 * (x0 - self.last_content_x) > space_width;
824+
4 * (x0 - self.last_content_x) > space_width
828825
}
829826

830827
fn update_content_pos(&mut self, x: i32, font_num: Option<FontNum>) {
@@ -1006,7 +1003,7 @@ impl EmittingState {
10061003
let mut double_quoted_attrs = Vec::new();
10071004

10081005
for line in lines {
1009-
if let Some(cls) = line.strip_prefix("C") {
1006+
if let Some(cls) = line.strip_prefix('C') {
10101007
// For later: apply any restrictions to allowed class names?
10111008
if !cls.is_empty() {
10121009
classes.push(cls.to_owned());
@@ -1017,7 +1014,7 @@ impl EmittingState {
10171014
cls
10181015
);
10191016
}
1020-
} else if let Some(rest) = line.strip_prefix("S") {
1017+
} else if let Some(rest) = line.strip_prefix('S') {
10211018
// For later: apply any restrictions to names/values here?
10221019
let mut bits = rest.splitn(2, ' ');
10231020
let name = match bits.next() {
@@ -1043,7 +1040,7 @@ impl EmittingState {
10431040
}
10441041
};
10451042
styles.push((name.to_owned(), value.to_owned()));
1046-
} else if let Some(rest) = line.strip_prefix("U") {
1043+
} else if let Some(rest) = line.strip_prefix('U') {
10471044
// For later: apply any restrictions to names/values here?
10481045
let mut bits = rest.splitn(2, ' ');
10491046
let name = match bits.next() {
@@ -1066,7 +1063,7 @@ impl EmittingState {
10661063
}
10671064
};
10681065
unquoted_attrs.push((name.to_owned(), bits.next().map(|v| v.to_owned())));
1069-
} else if let Some(rest) = line.strip_prefix("D") {
1066+
} else if let Some(rest) = line.strip_prefix('D') {
10701067
// For later: apply any restrictions to names/values here?
10711068
let mut bits = rest.splitn(2, ' ');
10721069
let name = match bits.next() {

0 commit comments

Comments
 (0)