use if let for single pattern

pull/329/head
xiaopengli89 4 years ago
parent ec39b36725
commit 65c20e6151

@ -137,11 +137,8 @@ where
Box::new(WordWrapper::new(&mut styled, text_area.width))
} else {
let mut line_composer = Box::new(LineTruncator::new(&mut styled, text_area.width));
match self.alignment {
Alignment::Left => {
line_composer.set_horizontal_offset(self.scroll.1);
}
_ => {}
if let Alignment::Left = self.alignment {
line_composer.set_horizontal_offset(self.scroll.1);
}
line_composer
};

Loading…
Cancel
Save