diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-02-24 20:03:12 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-24 20:03:12 -0500 |
commit | 3b12afd0723b288feb7c8c53ac3938a17fd0e57c (patch) | |
tree | 8ac398efaef6e59e3ab2278f378706aa44b5641e /cli/tools/fmt.rs | |
parent | c59152e4000393ad122855c26198c1d942497c00 (diff) |
chore: upgrade to Rust 1.59 (#13767)
Diffstat (limited to 'cli/tools/fmt.rs')
-rw-r--r-- | cli/tools/fmt.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs index 45cf69b86..4fba9ea13 100644 --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -234,7 +234,7 @@ pub fn format_file( file_text: &str, fmt_options: FmtOptionsConfig, ) -> Result<String, AnyError> { - let ext = get_extension(file_path).unwrap_or_else(String::new); + let ext = get_extension(file_path).unwrap_or_default(); if matches!( ext.as_str(), "md" | "mkd" | "mkdn" | "mdwn" | "mdown" | "markdown" @@ -589,8 +589,7 @@ where let mut errors = join_results.into_iter().filter_map(|join_result| { join_result .ok() - .map(|handle_result| handle_result.err()) - .flatten() + .and_then(|handle_result| handle_result.err()) }); if let Some(e) = errors.next() { |