diff options
author | Sam Tay <samctay@pm.me> | 2023-03-26 11:24:24 -0700 |
---|---|---|
committer | Sam Tay <samctay@pm.me> | 2023-03-26 11:32:17 -0700 |
commit | d6bcdb5476e7a4e6df7360e57af71609b2fb0732 (patch) | |
tree | 4ce40940e409d5cc314076de4c70217b1b9bd1f1 | |
parent | f033ced221a52befc34edc76a18162c6cf6e0b26 (diff) |
Appease clippyfix-clippy
-rw-r--r-- | src/config.rs | 8 | ||||
-rw-r--r-- | src/tui/markdown.rs | 10 |
2 files changed, 7 insertions, 11 deletions
diff --git a/src/config.rs b/src/config.rs index 888d22a..e11ebee 100644 --- a/src/config.rs +++ b/src/config.rs @@ -12,8 +12,10 @@ use crate::utils; #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "lowercase")] +#[derive(Default)] pub enum SearchEngine { DuckDuckGo, + #[default] Google, StackExchange, } @@ -40,12 +42,6 @@ impl fmt::Display for SearchEngine { } } -impl Default for SearchEngine { - fn default() -> Self { - SearchEngine::Google - } -} - // TODO make a friender config file, like the colors.toml below impl Default for Config { fn default() -> Self { diff --git a/src/tui/markdown.rs b/src/tui/markdown.rs index deeee30..62b60ae 100644 --- a/src/tui/markdown.rs +++ b/src/tui/markdown.rs @@ -236,7 +236,7 @@ Attention ==== I *really* love __Cursive__!"; let parsed = parse(input); - let spans: Vec<_> = parsed.spans().into_iter().collect(); + let spans: Vec<_> = parsed.spans().collect(); let expected_spans = &[ Span { content: "Attention", @@ -296,7 +296,7 @@ code fences ``` Obviously."; let parsed = parse(input); - let spans: Vec<_> = parsed.spans().into_iter().collect(); + let spans: Vec<_> = parsed.spans().collect(); let expected_spans = &[ Span { content: "project", @@ -403,7 +403,7 @@ and tasks - [x] done! "; let parsed = parse(input); - let spans: Vec<_> = parsed.spans().into_iter().collect(); + let spans: Vec<_> = parsed.spans().collect(); let expected_spans = &[ Span { content: "1. ", @@ -486,7 +486,7 @@ and tasks let input = " I'm on a Mac running OS X v10.6 (Snow Leopard). I have Mercurial 1.1 installed.\r\n\r\nAfter I hit <kbd>Esc</kbd> to exit insert mode I can't figure out how to save and quit. Hitting <kbd>Ctrl</kbd> + <kbd>C</kbd> shows me instructions that say typing \"quit<enter>\" will write and quit, but it doesn't seem to work.\r\n\r\n\r\n\r\n".to_string(); let parsed = parse(preprocess(input)); - let spans: Vec<_> = parsed.spans().into_iter().collect(); + let spans: Vec<_> = parsed.spans().collect(); let expected_spans = &[ Span { content: "I\'m on a Mac running OS", @@ -617,7 +617,7 @@ I'm on a Mac running OS X v10.6 (Snow Leopard). I have Mercurial let input = "1. Run the commands below, and compare the outputs\r\n\r\n\t\tsudo cat /etc/shadow"; let parsed = parse(input); - let spans: Vec<_> = parsed.spans().into_iter().collect(); + let spans: Vec<_> = parsed.spans().collect(); let expected_spans = &[ Span { content: "1. ", |