X-Git-Url: http://git.scottworley.com/tablify/blobdiff_plain/156f8d37e7451b5f31f02f32b0f0eb07df8c3954..9321d710d6048b57691ff08a62c93c1c8e30a721:/src/lib.rs diff --git a/src/lib.rs b/src/lib.rs index e199470..ac52b1f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -207,9 +207,7 @@ impl<'cfg, Input: Iterator>> Reader<'cfg, } } } -impl<'cfg, Input: Iterator>> Iterator - for Reader<'cfg, Input> -{ +impl>> Iterator for Reader<'_, Input> { type Item = Result; fn next(&mut self) -> Option { loop { @@ -423,7 +421,7 @@ fn column_header_labels<'a>( let dynamic_columns = columns.iter().map(Some); static_columns .chain(dynamic_columns) - .filter(|ocol| ocol.map_or(true, |col| !config.hidden_columns.contains(col))) + .filter(|ocol| ocol.is_none_or(|col| !config.hidden_columns.contains(col))) .map(|ocol| { ocol.map(|col| match config.substitute_labels.get(col) { None => col, @@ -459,7 +457,7 @@ fn render_column_headers(config: &Config, columns: &[String]) -> HTML { /// * there's an i/o error while reading `input` /// * the log has invalid syntax: /// * an indented line with no preceding non-indented line -pub fn tablify(input: impl std::io::Read) -> Result { +pub fn tablify(input: R) -> Result { let (rows, config) = read_input(input)?; let columns = column_order(&config, &rows); Ok(HTML(format!(