diff options
author | Sam Tay <samctay@pm.me> | 2023-02-03 23:59:39 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-03 23:59:39 -0800 |
commit | 46404f11040d5e7a14c217669f418168a96613df (patch) | |
tree | bf564d0a6dbdebf6533e4dbd117387dc3b36a37e | |
parent | a723ac18107bedb002d2b0eec338268efc9f67eb (diff) | |
parent | f8b0a4fc194284a0db26ba902eaa84769feb0146 (diff) |
Merge pull request #30 from samtay/clippy
Fix clippy warnings
-rw-r--r-- | src/config.rs | 2 | ||||
-rw-r--r-- | src/main.rs | 2 | ||||
-rw-r--r-- | src/tui/app.rs | 4 | ||||
-rw-r--r-- | src/tui/markdown.rs | 2 | ||||
-rw-r--r-- | src/tui/views.rs | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/src/config.rs b/src/config.rs index eaf62cd..888d22a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -36,7 +36,7 @@ impl fmt::Display for SearchEngine { SearchEngine::Google => "google", SearchEngine::StackExchange => "stackexchange", }; - write!(f, "{}", s) + write!(f, "{s}") } } diff --git a/src/main.rs b/src/main.rs index 032fee3..4547f47 100644 --- a/src/main.rs +++ b/src/main.rs @@ -67,7 +67,7 @@ async fn run() -> Result<Option<tui::App>> { } if let Some(site) = ls.find_invalid_site(sites).await { - term.print_error(&format!("{} is not a valid StackExchange site.\n\n", site))?; + term.print_error(&format!("{site} is not a valid StackExchange site.\n\n"))?; term.print_notice( "If you think this is incorrect, try running\n\ ```\n\ diff --git a/src/tui/app.rs b/src/tui/app.rs index 0f05d2c..647ef3e 100644 --- a/src/tui/app.rs +++ b/src/tui/app.rs @@ -218,7 +218,7 @@ fn pretty_score(score: i32) -> StyledString { Color::Light(BaseColor::Red) }; SpannedString::styled( - format!("({}) ", score), + format!("({score}) "), Style::merge(&[Style::from(color), Style::from(Effect::Bold)]), ) } @@ -262,7 +262,7 @@ pub fn temp_feedback_msg(siv: &mut Cursive, msg: io::Result<String>) { } else { Color::Light(BaseColor::Red) }; - let content = msg.unwrap_or_else(|e| format!("error: {}", e)); + let content = msg.unwrap_or_else(|e| format!("error: {e}")); let styled_content = SpannedString::styled(content, style); let layer = Dialog::around(TextView::new(styled_content)); let temp = TempView::new(layer, siv.cb_sink().clone()); diff --git a/src/tui/markdown.rs b/src/tui/markdown.rs index dd38992..deeee30 100644 --- a/src/tui/markdown.rs +++ b/src/tui/markdown.rs @@ -178,7 +178,7 @@ impl<'a, 'b> Iterator for Parser<'a, 'b> { return Some(self.literal("\n\n")); } // TODO underline the link? - Tag::Link(_, link, _) => return Some(self.literal(format!("]({})", link))), + Tag::Link(_, link, _) => return Some(self.literal(format!("]({link})"))), Tag::CodeBlock(_) => { self.after_code_block = true; self.stack.pop().unwrap(); diff --git a/src/tui/views.rs b/src/tui/views.rs index ef96a6a..2fbdabe 100644 --- a/src/tui/views.rs +++ b/src/tui/views.rs @@ -143,7 +143,7 @@ impl ListView { } let view = view.with_name(&inner_name); let view = view.scrollable(); - let view = Panel::new(view).title(format!("{}", name)); + let view = Panel::new(view).title(format!("{name}")); let view = view.resized(SizeConstraint::Free, SizeConstraint::Free); let view = HideableView::new(view); let view = ListViewT { |