Skip to content

Commit e7db16a

Browse files
euankLinuxMercedes
authored andcommitted
Fix clippy's warnings
1 parent 2fabea4 commit e7db16a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/main.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ fn main() {
104104
.map(|x| x.to_string())
105105
.collect()
106106
})
107-
.unwrap_or(vec![]);
107+
.unwrap_or_default();
108108

109-
let channels: Vec<String> = if sanitized_chans.len() != 0 || raw_in {
109+
let channels: Vec<String> = if !sanitized_chans.is_empty() || raw_in {
110110
sanitized_chans
111111
} else {
112112
vec!["#hashpipe".to_string()]
@@ -118,7 +118,7 @@ fn main() {
118118
(_, true) => LogLevelFilter::Error,
119119
(0, _) => LogLevelFilter::Warn,
120120
(1, _) => LogLevelFilter::Info,
121-
(2, _) | _ => LogLevelFilter::Debug,
121+
_ => LogLevelFilter::Debug,
122122
};
123123
builder.filter(None, level);
124124
builder.init().unwrap();
@@ -275,8 +275,7 @@ fn run_irc(client: IrcClient, raw: bool, quiet: bool, sjoin: chan::Sender<Action
275275
Command::Response(ref response, ref command, ref err) => {
276276
// Handle un-joinable channels
277277
let the_problem = command.get(1).map_or("", |s| &*s);
278-
let errmsg =
279-
the_problem.to_string() + ": " + &err.clone().unwrap_or("".to_string());
278+
let errmsg = the_problem.to_string() + ": " + &err.clone().unwrap_or_default();
280279

281280
match *response {
282281
Response::ERR_CHANNELISFULL => sjoin.send(Action::JoinFail(errmsg)),

0 commit comments

Comments
 (0)