cargo fmt
This commit is contained in:
parent
ef4c554820
commit
302ac9b050
1 changed files with 16 additions and 8 deletions
24
src/main.rs
24
src/main.rs
|
@ -82,7 +82,10 @@ impl Cri {
|
||||||
let command = tokens.next().unwrap();
|
let command = tokens.next().unwrap();
|
||||||
match command {
|
match command {
|
||||||
"/join" => {
|
"/join" => {
|
||||||
let channel = tokens.next().map(str::to_string).or_else(|| self.message_log.active_channel.clone());
|
let channel = tokens
|
||||||
|
.next()
|
||||||
|
.map(str::to_string)
|
||||||
|
.or_else(|| self.message_log.active_channel.clone());
|
||||||
if channel.is_none() {
|
if channel.is_none() {
|
||||||
// TODO error message
|
// TODO error message
|
||||||
return;
|
return;
|
||||||
|
@ -94,16 +97,21 @@ impl Cri {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
self
|
self.input_tx
|
||||||
.input_tx
|
.borrow()
|
||||||
.borrow()
|
.send(
|
||||||
.send(IrcCommand::JOIN(channel.clone(), tokens.next().map(str::to_string), None).into())
|
IrcCommand::JOIN(channel.clone(), tokens.next().map(str::to_string), None)
|
||||||
.unwrap();
|
.into(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
self.message_log.set_active(Some(channel));
|
self.message_log.set_active(Some(channel));
|
||||||
},
|
}
|
||||||
"/part" => {
|
"/part" => {
|
||||||
let channel = tokens.next().map(str::to_string).or_else(|| self.message_log.active_channel.clone());
|
let channel = tokens
|
||||||
|
.next()
|
||||||
|
.map(str::to_string)
|
||||||
|
.or_else(|| self.message_log.active_channel.clone());
|
||||||
if channel.is_none() {
|
if channel.is_none() {
|
||||||
// TODO error message
|
// TODO error message
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue