Changed examples to be formatted more readibly.
This commit is contained in:
parent
514a08d838
commit
d57bb11994
2 changed files with 20 additions and 28 deletions
|
@ -13,20 +13,16 @@ fn main() {
|
||||||
};
|
};
|
||||||
let server = IrcServer::from_config(config).unwrap();
|
let server = IrcServer::from_config(config).unwrap();
|
||||||
server.identify().unwrap();
|
server.identify().unwrap();
|
||||||
server
|
server.stream().for_each(|message| {
|
||||||
.stream()
|
print!("{}", message);
|
||||||
.for_each(|message| {
|
match message.command {
|
||||||
print!("{}", message);
|
Command::PRIVMSG(ref target, ref msg) => {
|
||||||
match message.command {
|
if msg.contains("pickles") {
|
||||||
Command::PRIVMSG(ref target, ref msg) => {
|
server.send_privmsg(target, "Hi!").unwrap();
|
||||||
if msg.contains("pickles") {
|
|
||||||
server.send_privmsg(target, "Hi!").unwrap();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_ => (),
|
|
||||||
}
|
}
|
||||||
Ok(())
|
_ => (),
|
||||||
})
|
}
|
||||||
.wait()
|
Ok(())
|
||||||
.unwrap()
|
}).wait().unwrap()
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,20 +14,16 @@ fn main() {
|
||||||
};
|
};
|
||||||
let server = IrcServer::from_config(config).unwrap();
|
let server = IrcServer::from_config(config).unwrap();
|
||||||
server.identify().unwrap();
|
server.identify().unwrap();
|
||||||
server
|
server.stream().for_each(|message| {
|
||||||
.stream()
|
print!("{}", message);
|
||||||
.for_each(|message| {
|
match message.command {
|
||||||
print!("{}", message);
|
Command::PRIVMSG(ref target, ref msg) => {
|
||||||
match message.command {
|
if msg.contains("pickles") {
|
||||||
Command::PRIVMSG(ref target, ref msg) => {
|
server.send_privmsg(target, "Hi!").unwrap();
|
||||||
if msg.contains("pickles") {
|
|
||||||
server.send_privmsg(target, "Hi!").unwrap();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_ => (),
|
|
||||||
}
|
}
|
||||||
Ok(())
|
_ => (),
|
||||||
})
|
}
|
||||||
.wait()
|
Ok(())
|
||||||
.unwrap()
|
}).wait().unwrap()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue