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();
|
||||
server.identify().unwrap();
|
||||
server
|
||||
.stream()
|
||||
.for_each(|message| {
|
||||
print!("{}", message);
|
||||
match message.command {
|
||||
Command::PRIVMSG(ref target, ref msg) => {
|
||||
if msg.contains("pickles") {
|
||||
server.send_privmsg(target, "Hi!").unwrap();
|
||||
}
|
||||
server.stream().for_each(|message| {
|
||||
print!("{}", message);
|
||||
match message.command {
|
||||
Command::PRIVMSG(ref target, ref msg) => {
|
||||
if msg.contains("pickles") {
|
||||
server.send_privmsg(target, "Hi!").unwrap();
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
Ok(())
|
||||
})
|
||||
.wait()
|
||||
.unwrap()
|
||||
_ => (),
|
||||
}
|
||||
Ok(())
|
||||
}).wait().unwrap()
|
||||
}
|
||||
|
|
|
@ -14,20 +14,16 @@ fn main() {
|
|||
};
|
||||
let server = IrcServer::from_config(config).unwrap();
|
||||
server.identify().unwrap();
|
||||
server
|
||||
.stream()
|
||||
.for_each(|message| {
|
||||
print!("{}", message);
|
||||
match message.command {
|
||||
Command::PRIVMSG(ref target, ref msg) => {
|
||||
if msg.contains("pickles") {
|
||||
server.send_privmsg(target, "Hi!").unwrap();
|
||||
}
|
||||
server.stream().for_each(|message| {
|
||||
print!("{}", message);
|
||||
match message.command {
|
||||
Command::PRIVMSG(ref target, ref msg) => {
|
||||
if msg.contains("pickles") {
|
||||
server.send_privmsg(target, "Hi!").unwrap();
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
Ok(())
|
||||
})
|
||||
.wait()
|
||||
.unwrap()
|
||||
_ => (),
|
||||
}
|
||||
Ok(())
|
||||
}).wait().unwrap()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue