Rust 1.49 Clippy Fixes (#2835)

This commit is contained in:
Joseph T. Lyons
2020-12-31 21:13:59 -05:00
committed by GitHub
parent 3ef53fe2cd
commit 15d49e4096
19 changed files with 25 additions and 28 deletions

View File

@ -46,10 +46,7 @@ impl TextStyle {
}
pub fn bold(&self, bool_value: Option<bool>) -> TextStyle {
let bv = match bool_value {
Some(v) => v,
None => false,
};
let bv = bool_value.unwrap_or(false);
TextStyle {
alignment: self.alignment,

View File

@ -74,7 +74,7 @@ pub fn split_sublines(input: &str) -> Vec<Vec<Subline>> {
.collect::<Vec<_>>()
}
pub fn column_width<'a>(input: &[Vec<Subline<'a>>]) -> usize {
pub fn column_width(input: &[Vec<Subline>]) -> usize {
let mut max = 0;
for line in input {
@ -100,7 +100,7 @@ pub fn column_width<'a>(input: &[Vec<Subline<'a>>]) -> usize {
max
}
fn split_word<'a>(cell_width: usize, word: &'a str) -> Vec<Subline<'a>> {
fn split_word(cell_width: usize, word: &str) -> Vec<Subline> {
use unicode_width::UnicodeWidthChar;
let mut output = vec![];