Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

feat: config file (still broken but implemented, need tests #78

feat: config file (still broken but implemented, need tests

feat: config file (still broken but implemented, need tests #78

Triggered via push October 12, 2023 00:08
Status Success
Total duration 1m 14s
Artifacts
This run and associated checks have been archived and are scheduled for deletion. Learn more about checks retention

clippy.yml

on: push
Fit to window
Zoom out
Zoom in

Annotations

84 warnings
unused `std::result::Result` that must be used: src/screens/input/input.rs#L164
warning: unused `std::result::Result` that must be used --> src/screens/input/input.rs:164:13 | 164 | app.command.as_mut().unwrap().write_output(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled help: use `let _ = ...` to ignore the resulting value | 164 | let _ = app.command.as_mut().unwrap().write_output(); | +++++++
unused `std::result::Result` that must be used: src/app.rs#L158
warning: unused `std::result::Result` that must be used --> src/app.rs:158:9 | 158 | self.command.as_mut().unwrap().execute(self.db.as_mut()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled = note: `#[warn(unused_must_use)]` on by default help: use `let _ = ...` to ignore the resulting value | 158 | let _ = self.command.as_mut().unwrap().execute(self.db.as_mut()); | +++++++
length comparison to zero: src/events/handler.rs#L26
warning: length comparison to zero --> src/events/handler.rs:26:32 | 26 | ... if app.input.value().len() > 0 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!app.input.value().is_empty()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero = note: `#[warn(clippy::len_zero)]` on by default
useless conversion to the same type: `mockito::ServerGuard`: src/request/wget.rs#L224
warning: useless conversion to the same type: `mockito::ServerGuard` --> src/request/wget.rs:224:16 | 224 | return ServerGuard::from(server); | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `ServerGuard::from()`: `server` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
unneeded `return` statement: src/request/wget.rs#L224
warning: unneeded `return` statement --> src/request/wget.rs:224:9 | 224 | return ServerGuard::from(server); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 224 - return ServerGuard::from(server); 224 + ServerGuard::from(server) |
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/wget.rs#L198
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/wget.rs:198:9 | 198 | / match self.auth.clone() { 199 | | Some(ref auth) => self.cmd.push(auth.clone()), 200 | | None => (), 201 | | } | |_________^ help: try this: `if let Some(ref auth) = self.auth.clone() { self.cmd.push(auth.clone()) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you should consider adding a `Default` implementation for `Wget`: src/request/wget.rs#L125
warning: you should consider adding a `Default` implementation for `Wget` --> src/request/wget.rs:125:5 | 125 | / pub fn new() -> Self { 126 | | Wget { 127 | | cmd: vec![String::from("wget")], 128 | | rec_level: None, ... | 133 | | } 134 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default = note: `#[warn(clippy::new_without_default)]` on by default help: try adding this | 123 + impl Default for Wget { 124 + fn default() -> Self { 125 + Self::new() 126 + } 127 + } |
single-character string constant used as pattern: src/request/wget.rs#L73
warning: single-character string constant used as pattern --> src/request/wget.rs:73:36 | 73 | let mut split = info.split(":"); | ^^^ help: try using a `char` instead: `':'` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern = note: `#[warn(clippy::single_char_pattern)]` on by default
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/wget.rs#L42
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/wget.rs:42:9 | 42 | / match self.auth.clone() { 43 | | Some(ref auth) => cmdstr.push(auth.clone()), 44 | | None => (), 45 | | } | |_________^ help: try this: `if let Some(ref auth) = self.auth.clone() { cmdstr.push(auth.clone()) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
`to_string` applied to a type that implements `Display` in `format!` args: src/request/curl.rs#L933
warning: `to_string` applied to a type that implements `Display` in `format!` args --> src/request/curl.rs:933:59 | 933 | Some(format!("Authorization: Bearer {}", token.to_string())), | ^^^^^^^^^^^^ help: remove this | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args = note: `#[warn(clippy::to_string_in_format_args)]` on by default
this let-binding has unit value: src/request/curl.rs#L403
warning: this let-binding has unit value --> src/request/curl.rs:403:13 | 403 | let _ = self.curl.perform().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `self.curl.perform().unwrap();` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
redundant pattern matching, consider using `is_ok()`: src/request/curl.rs#L394
warning: redundant pattern matching, consider using `is_ok()` --> src/request/curl.rs:394:24 | 394 | if let Ok(_) = self.curl.send(buff.as_slice()) { | -------^^^^^---------------------------------- help: try this: `if self.curl.send(buff.as_slice()).is_ok()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
redundant pattern matching, consider using `is_ok()`: src/request/curl.rs#L392
warning: redundant pattern matching, consider using `is_ok()` --> src/request/curl.rs:392:20 | 392 | if let Ok(_) = self.curl.perform() { | -------^^^^^---------------------- help: try this: `if self.curl.perform().is_ok()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching = note: `#[warn(clippy::redundant_pattern_matching)]` on by default
this let-binding has unit value: src/request/curl.rs#L391
warning: this let-binding has unit value --> src/request/curl.rs:391:13 | 391 | let _ = self.curl.connect_only(true).unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `self.curl.connect_only(true).unwrap();` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value = note: `#[warn(clippy::let_unit_value)]` on by default
unneeded `return` statement: src/request/curl.rs#L395
warning: unneeded `return` statement --> src/request/curl.rs:395:21 | 395 | return Ok(()); | ^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 395 - return Ok(()); 395 + Ok(()) |
useless conversion to the same type: `std::string::String`: src/request/curl.rs#L312
warning: useless conversion to the same type: `std::string::String` --> src/request/curl.rs:312:9 | 312 | String::from(self.url.clone()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `self.url.clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
using `clone` on type `bool` which implements the `Copy` trait: src/request/curl.rs#L226
warning: using `clone` on type `bool` which implements the `Copy` trait --> src/request/curl.rs:226:24 | 226 | save_auth: self.save_auth.clone(), | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.save_auth` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
using `clone` on type `bool` which implements the `Copy` trait: src/request/curl.rs#L225
warning: using `clone` on type `bool` which implements the `Copy` trait --> src/request/curl.rs:225:19 | 225 | save: self.save.clone(), | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.save` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy = note: `#[warn(clippy::clone_on_copy)]` on by default
this expression creates a reference which is immediately dereferenced by the compiler: src/request/curl.rs#L207
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/request/curl.rs:207:30 | 207 | curl.set_outfile(&outfile); | ^^^^^^^^ help: change this to: `outfile` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L225
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:225:9 | 225 | / match self { 226 | | Cmd::Curl(curl) => curl.set_user_agent(ua), 227 | | _ => {} 228 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.set_user_agent(ua) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L219
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:219:9 | 219 | / match self { 220 | | Cmd::Curl(curl) => curl.set_ca_path(path), 221 | | _ => {} 222 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.set_ca_path(path) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L213
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:213:9 | 213 | / match self { 214 | | Cmd::Curl(curl) => curl.set_max_redirects(redirects), 215 | | _ => {} 216 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.set_max_redirects(redirects) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L207
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:207:9 | 207 | / match self { 208 | | Cmd::Curl(curl) => curl.set_referrer(referrer), 209 | | _ => {} 210 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.set_referrer(referrer) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L201
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:201:9 | 201 | / match self { 202 | | Cmd::Curl(curl) => curl.set_unrestricted_auth(opt), 203 | | _ => {} 204 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.set_unrestricted_auth(opt) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L195
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:195:9 | 195 | / match self { 196 | | Cmd::Curl(curl) => curl.set_tcp_keepalive(opt), 197 | | _ => {} 198 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.set_tcp_keepalive(opt) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L183
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:183:9 | 183 | / match self { 184 | | Cmd::Curl(curl) => curl.remove_headers(headers), 185 | | _ => {} 186 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.remove_headers(headers) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L171
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:171:9 | 171 | / match self { 172 | | Cmd::Curl(curl) => curl.save_token(opt), 173 | | _ => {} 174 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.save_token(opt) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L165
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:165:9 | 165 | / match self { 166 | | Cmd::Curl(curl) => curl.set_unix_socket(socket), 167 | | _ => {} 168 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.set_unix_socket(socket) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L159
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:159:9 | 159 | / match self { 160 | | Cmd::Curl(curl) => curl.set_verbose(opt), 161 | | _ => {} 162 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.set_verbose(opt) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L153
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:153:9 | 153 | / match self { 154 | | Cmd::Curl(curl) => curl.set_headers(headers), 155 | | _ => {} 156 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.set_headers(headers) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L147
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:147:9 | 147 | / match self { 148 | | Cmd::Curl(curl) => curl.save_command(opt), 149 | | _ => {} 150 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.save_command(opt) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L141
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:141:9 | 141 | / match self { 142 | | Cmd::Curl(curl) => curl.set_fail_on_error(opt), 143 | | _ => {} 144 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.set_fail_on_error(opt) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L135
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:135:9 | 135 | / match self { 136 | | Cmd::Curl(curl) => curl.set_cert_info(opt), 137 | | _ => {} 138 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.set_cert_info(opt) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L129
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:129:9 | 129 | / match self { 130 | | Cmd::Curl(curl) => curl.enable_progress_bar(opt), 131 | | _ => {} 132 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.enable_progress_bar(opt) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L123
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:123:9 | 123 | / match self { 124 | | Cmd::Curl(curl) => curl.enable_response_headers(opt), 125 | | _ => {} 126 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.enable_response_headers(opt) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L117
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:117:9 | 117 | / match self { 118 | | Cmd::Curl(curl) => curl.add_headers(headers), 119 | | _ => {} 120 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.add_headers(headers) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L111
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:111:9 | 111 | / match self { 112 | | Cmd::Curl(curl) => curl.set_auth(auth), 113 | | _ => {} 114 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.set_auth(auth) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L105
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:105:9 | 105 | / match self { 106 | | Cmd::Curl(curl) => curl.set_method(method), 107 | | _ => {} 108 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.set_method(method) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L93
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:93:9 | 93 | / match self { 94 | | Cmd::Curl(curl) => curl.match_wildcard(opt), 95 | | _ => {} 96 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.match_wildcard(opt) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L87
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:87:9 | 87 | / match self { 88 | | Cmd::Curl(curl) => curl.set_proxy_tunnel(opt), 89 | | _ => {} 90 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.set_proxy_tunnel(opt) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L81
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:81:9 | 81 | / match self { 82 | | Cmd::Curl(curl) => curl.set_follow_redirects(opt), 83 | | _ => {} 84 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.set_follow_redirects(opt) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L75
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:75:9 | 75 | / match self { 76 | | Cmd::Curl(curl) => curl.add_cookie(cookie), 77 | | _ => {} 78 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.add_cookie(cookie) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/request/command.rs#L24
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/request/command.rs:24:9 | 24 | / match self { 25 | | Cmd::Curl(curl) => curl.add_basic_auth(info), 26 | | _ => {} 27 | | } | |_________^ help: try this: `if let Cmd::Curl(curl) = self { curl.add_basic_auth(info) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
useless use of `format!`: src/display/mod.rs#L92
warning: useless use of `format!` --> src/display/mod.rs:92:41 | 92 | AppOptions::Headers(key) => format!("{}", key), | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `key.to_string()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format = note: `#[warn(clippy::useless_format)]` on by default
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/screens/saved_commands.rs#L25
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/screens/saved_commands.rs:25:5 | 25 | / match app.selected { 26 | | Some(cmd) => { 27 | | app.execute_saved_command(cmd); 28 | | app.goto_screen(Screen::Response(app.response.as_ref().unwrap().clone())); ... | 31 | | None => {} 32 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match help: try this | 25 ~ if let Some(cmd) = app.selected { 26 + app.execute_saved_command(cmd); 27 + app.goto_screen(Screen::Response(app.response.as_ref().unwrap().clone())); 28 + app.selected = None; 29 + } |
this expression creates a reference which is immediately dereferenced by the compiler: src/screens/saved_commands.rs#L24
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/screens/saved_commands.rs:24:51 | 24 | frame.render_stateful_widget(list, alert_box, &mut app.state.as_mut().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `app.state.as_mut().unwrap()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
the following explicit lifetimes could be elided: 'a: src/screens/input/url.rs#L39
warning: the following explicit lifetimes could be elided: 'a --> src/screens/input/url.rs:39:24 | 39 | fn create_screen_title<'a>(title_str: &'a str) -> Paragraph<'a> { | ^^ ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 39 - fn create_screen_title<'a>(title_str: &'a str) -> Paragraph<'a> { 39 + fn create_screen_title(title_str: &str) -> Paragraph<'_> { |
the following explicit lifetimes could be elided: 'a: src/screens/input/test.rs#L57
warning: the following explicit lifetimes could be elided: 'a --> src/screens/input/test.rs:57:24 | 57 | fn create_screen_title<'a>(title_str: &'a str) -> Paragraph<'a> { | ^^ ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes = note: `#[warn(clippy::needless_lifetimes)]` on by default help: elide the lifetimes | 57 - fn create_screen_title<'a>(title_str: &'a str) -> Paragraph<'a> { 57 + fn create_screen_title(title_str: &str) -> Paragraph<'_> { |
very complex type used. Consider factoring parts into `type` definitions: src/screens/input/test.rs#L12
warning: very complex type used. Consider factoring parts into `type` definitions --> src/screens/input/test.rs:12:59 | 12 | fn create_layout<B: Backend>(frame: &mut Frame<'_, B>) -> (Rc<[Rect]>, Rc<[Rect]>, Rc<[Rect]>) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity = note: `#[warn(clippy::type_complexity)]` on by default
unneeded `return` statement: src/screens/input/input.rs#L25
warning: unneeded `return` statement --> src/screens/input/input.rs:25:5 | 25 | / return match opt { 26 | | InputOpt::URL(opt) => { 27 | | let fmtstr = format!("Enter a URL for your {}\n and press Enter", opt); 28 | | Text::from(Line::from(fmtstr)) ... | 37 | | _ => Text::from(INPUT_OPT_BASIC), 38 | | }; | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 25 ~ match opt { 26 + InputOpt::URL(opt) => { 27 + let fmtstr = format!("Enter a URL for your {}\n and press Enter", opt); 28 + Text::from(Line::from(fmtstr)) 29 + } 30 + InputOpt::Headers => Text::from(Line::from(INPUT_OPT_HEADERS)), 31 + InputOpt::RecursiveDownload => Text::from(INPUT_OPT_REC_DOWNLOAD), 32 + InputOpt::Auth(auth) => match auth { 33 + AuthType::Basic => Text::from(INPUT_OPT_AUTH_BASIC), 34 + AuthType::Bearer => Text::from(INPUT_OPT_AUTH_BEARER), 35 + _ => Text::from(INPUT_OPT_AUTH_ANY), 36 + }, 37 + _ => Text::from(INPUT_OPT_BASIC), 38 ~ } |
module has the same name as its containing module: src/screens/input/mod.rs#L1
warning: module has the same name as its containing module --> src/screens/input/mod.rs:1:1 | 1 | pub mod input; | ^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception = note: `#[warn(clippy::module_inception)]` on by default
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/screens/response.rs#L32
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/screens/response.rs:32:5 | 32 | / match app.selected { 33 | | Some(num) => match num { 34 | | 0 => { 35 | | app.goto_screen(Screen::InputMenu(InputOpt::Execute)); ... | 60 | | None => {} 61 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match help: try this | 32 ~ if let Some(num) = app.selected { match num { 33 + 0 => { 34 + app.goto_screen(Screen::InputMenu(InputOpt::Execute)); 35 + } 36 + // View response headers 37 + 1 => { 38 + let area_2 = small_alert_box(frame.size()); 39 + let response = Response::from_raw_string(resp.as_str()).unwrap(); 40 + let headers = response.get_headers(); 41 + let paragraph = Paragraph::new(Text::from(headers.to_string())); 42 + frame.render_widget(paragraph, area_2); 43 + app.goto_screen(Screen::SavedCommands); 44 + } 45 + // View response body 46 + 2 => { 47 + app.goto_screen(Screen::ViewBody); 48 + } 49 + // Copy to clipboard 50 + 3 => { 51 + match copy_to_clipboard(app.command.as_mut().unwrap().get_command_string().as_str()) 52 + { 53 + Ok(_) => app.goto_screen(Screen::Success), 54 + Err(e) => app.goto_screen(Screen::Error(e.to_string())), 55 + } 56 + } 57 + _ => {} 58 + } } |
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/screens/method.rs#L13
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/screens/method.rs:13:5 | 13 | / match app.selected { 14 | | Some(num) => { 15 | | app.command 16 | | .as_mut() ... | 21 | | _ => {} 22 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match = note: `#[warn(clippy::single_match)]` on by default help: try this | 13 ~ if let Some(num) = app.selected { 14 + app.command 15 + .as_mut() 16 + .unwrap() 17 + .set_method(String::from(METHOD_MENU_OPTIONS[num])); // safe index 18 + app.goto_screen(Screen::RequestMenu(String::from(METHOD_MENU_OPTIONS[num]))); 19 + } |
useless conversion to the same type: `std::string::String`: src/screens/screen.rs#L143
warning: useless conversion to the same type: `std::string::String` --> src/screens/screen.rs:143:30 | 143 | .map(|x| String::from(format!("{}{}", x, determine_line_size()))) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `format!("{}{}", x, determine_line_size())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
useless conversion to the same type: `std::string::String`: src/screens/screen.rs#L127
warning: useless conversion to the same type: `std::string::String` --> src/screens/screen.rs:127:30 | 127 | .map(|x| String::from(format!("{}{}", x, determine_line_size()))) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `format!("{}{}", x, determine_line_size())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
useless conversion to the same type: `std::string::String`: src/screens/screen.rs#L117
warning: useless conversion to the same type: `std::string::String` --> src/screens/screen.rs:117:30 | 117 | .map(|x| String::from(format!("{}{}", x, OPTION_PADDING_MIN))) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `format!("{}{}", x, OPTION_PADDING_MIN)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
useless conversion to the same type: `std::string::String`: src/screens/screen.rs#L103
warning: useless conversion to the same type: `std::string::String` --> src/screens/screen.rs:103:30 | 103 | .map(|x| String::from(format!("{}{}", x, OPTION_PADDING_MID))) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `format!("{}{}", x, OPTION_PADDING_MID)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
useless conversion to the same type: `std::string::String`: src/screens/screen.rs#L96
warning: useless conversion to the same type: `std::string::String` --> src/screens/screen.rs:96:30 | 96 | .map(|x| String::from(format!("{}{}", x, determine_line_size()))) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `format!("{}{}", x, determine_line_size())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
useless conversion to the same type: `std::string::String`: src/screens/screen.rs#L89
warning: useless conversion to the same type: `std::string::String` --> src/screens/screen.rs:89:30 | 89 | .map(|x| String::from(format!("{}{}", x, determine_line_size()))) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `format!("{}{}", x, determine_line_size())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
useless conversion to the same type: `std::string::String`: src/screens/screen.rs#L82
warning: useless conversion to the same type: `std::string::String` --> src/screens/screen.rs:82:30 | 82 | .map(|x| String::from(format!("{}{}", x, determine_line_size()))) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `format!("{}{}", x, determine_line_size())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
method `default` can be confused for the standard trait method `std::default::Default::default`: src/screens/screen.rs#L73
warning: method `default` can be confused for the standard trait method `std::default::Default::default` --> src/screens/screen.rs:73:5 | 73 | / pub fn default() -> Self { 74 | | Screen::Home 75 | | } | |_____^ | = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait = note: `#[warn(clippy::should_implement_trait)]` on by default
unneeded `return` statement: src/screens/screen.rs#L68
warning: unneeded `return` statement --> src/screens/screen.rs:68:19 | 68 | Err(_) => return OPTION_PADDING_MID, | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 68 | Err(_) => OPTION_PADDING_MID, | ~~~~~~~~~~~~~~~~~~
unneeded `return` statement: src/screens/screen.rs#L66
warning: unneeded `return` statement --> src/screens/screen.rs:66:13 | 66 | return OPTION_PADDING_MIN; | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 66 - return OPTION_PADDING_MIN; 66 + OPTION_PADDING_MIN |
the borrowed expression implements the required traits: src/database/db.rs#L39
warning: the borrowed expression implements the required traits --> src/database/db.rs:39:13 | 39 | &dbpath, | ^^^^^^^ help: change this to: `dbpath` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/app.rs#L527
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/app.rs:527:72 | 527 | self.command.as_mut().unwrap().set_unix_socket(&socket); | ^^^^^^^ help: change this to: `socket` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/app.rs#L512
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/app.rs:512:68 | 512 | self.command.as_mut().unwrap().set_ca_path(&ca_path); | ^^^^^^^^ help: change this to: `ca_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
useless conversion to the same type: `std::string::String`: src/app.rs#L505
warning: useless conversion to the same type: `std::string::String` --> src/app.rs:505:46 | 505 | option.replace_value(String::from(cookie.clone())); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `cookie.clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion = note: `#[warn(clippy::useless_conversion)]` on by default
this expression creates a reference which is immediately dereferenced by the compiler: src/app.rs#L500
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/app.rs:500:69 | 500 | self.command.as_mut().unwrap().set_referrer(&referrer); | ^^^^^^^^^ help: change this to: `referrer` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/app.rs#L494
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/app.rs:494:71 | 494 | self.command.as_mut().unwrap().set_user_agent(&agent); | ^^^^^^ help: change this to: `agent` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/app.rs#L481
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/app.rs:481:69 | 481 | self.command.as_mut().unwrap().set_response(&response); | ^^^^^^^^^ help: change this to: `response` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/app.rs#L475
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/app.rs:475:68 | 475 | self.command.as_mut().unwrap().set_outfile(&outfile); | ^^^^^^^^ help: change this to: `outfile` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/app.rs#L468
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/app.rs:468:64 | 468 | self.command.as_mut().unwrap().set_url(&url); | ^^^^ help: change this to: `url` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
unneeded `return` statement: src/app.rs#L391
warning: unneeded `return` statement --> src/app.rs:391:64 | 391 | self.command.as_mut().unwrap().set_outfile(""); | ________________________________________________________________^ 392 | | return; | |______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 391 - self.command.as_mut().unwrap().set_outfile(""); 392 - return; 391 + self.command.as_mut().unwrap().set_outfile(""); |
unneeded `return` statement: src/app.rs#L387
warning: unneeded `return` statement --> src/app.rs:387:74 | 387 | self.command.as_mut().unwrap().set_rec_download_level(0); | __________________________________________________________________________^ 388 | | return; | |______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 387 - self.command.as_mut().unwrap().set_rec_download_level(0); 388 - return; 387 + self.command.as_mut().unwrap().set_rec_download_level(0); |
unneeded `return` statement: src/app.rs#L383
warning: unneeded `return` statement --> src/app.rs:383:60 | 383 | self.command.as_mut().unwrap().set_url(""); | ____________________________________________________________^ 384 | | return; | |______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 383 - self.command.as_mut().unwrap().set_url(""); 384 - return; 383 + self.command.as_mut().unwrap().set_url(""); |
this expression creates a reference which is immediately dereferenced by the compiler: src/app.rs#L325
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/app.rs:325:67 | 325 | .retain(|x| mem::discriminant(x) != mem::discriminant(&opt)); | ^^^^ help: change this to: `opt` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
unneeded `return` statement: src/app.rs#L231
warning: unneeded `return` statement --> src/app.rs:231:17 | 231 | return Ok(()); | ^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return = note: `#[warn(clippy::needless_return)]` on by default help: remove `return` | 231 - return Ok(()); 231 + Ok(()) |
you are using an explicit closure for cloning elements: src/app.rs#L186
warning: you are using an explicit closure for cloning elements --> src/app.rs:186:17 | 186 | let _ = saved_commands.iter().map(|x| x.clone()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `saved_commands.iter().cloned()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone = note: `#[warn(clippy::map_clone)]` on by default
function `setup` is never used: src/request/wget.rs#L216
warning: function `setup` is never used --> src/request/wget.rs:216:8 | 216 | fn setup() -> ServerGuard { | ^^^^^
method `has_auth` is never used: src/request/wget.rs#L184
warning: method `has_auth` is never used --> src/request/wget.rs:184:8 | 123 | impl Wget { | --------- method in this implementation ... 184 | fn has_auth(&self) -> bool { | ^^^^^^^^ | = note: `#[warn(dead_code)]` on by default
unused import: `CUTE_LOGO`: src/screens/render.rs#L3
warning: unused import: `CUTE_LOGO` --> src/screens/render.rs:3:56 | 3 | API_KEY_PARAGRAPH, API_KEY_TITLE, AUTH_MENU_TITLE, CUTE_LOGO, DEFAULT_MENU_PARAGRAPH, | ^^^^^^^^^
unused import: `crate::request::command::Cmd`: src/screens/response.rs#L4
warning: unused import: `crate::request::command::Cmd` --> src/screens/response.rs:4:5 | 4 | use crate::request::command::Cmd; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
unused import: `display::menuopts::CUTE_LOGO2`: src/lib.rs#L7
warning: unused import: `display::menuopts::CUTE_LOGO2` --> src/lib.rs:7:5 | 7 | use display::menuopts::CUTE_LOGO2; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
clippy_check
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/