summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-09-04 11:54:28 -0400
committerJesse Luehrs <doy@tozt.net>2014-09-04 11:54:28 -0400
commita17de7ec09e41789d469a5c939894c54f494ad4e (patch)
tree2d04e018b6bad9f2eb8dc527da453c4949b89002 /examples
parenta9b5293a5f1d8c5333f5ebd4a0b153755edd00b7 (diff)
downloadrust-irc-a17de7ec09e41789d469a5c939894c54f494ad4e.tar.gz
rust-irc-a17de7ec09e41789d469a5c939894c54f494ad4e.zip
move connection initialization into the client
Diffstat (limited to 'examples')
-rw-r--r--examples/client.rs25
1 files changed, 1 insertions, 24 deletions
diff --git a/examples/client.rs b/examples/client.rs
index 90a6b32..98900ef 100644
--- a/examples/client.rs
+++ b/examples/client.rs
@@ -1,30 +1,7 @@
extern crate irc;
-use irc::constants::{CommandMessage, Nick, User};
-
fn main () {
- let mut client = irc::Client::new("doytest", "chat.freenode.net", 6667);
- client.connect();
-
- client.write(
- irc::Message::new(
- None,
- CommandMessage(Nick),
- vec!["doytest".to_string()],
- )
- );
- client.write(
- irc::Message::new(
- None,
- CommandMessage(User),
- vec![
- "doytest".to_string(),
- "localhost".to_string(),
- "localhost".to_string(),
- "doytest".to_string(),
- ],
- )
- );
+ let mut client = irc::ClientBuilder::new("doytest", "chat.freenode.net").connect();
loop {
let res = client.read();