aatxe/irc — pull request #11 by SBSTP (2014-12-31 23:51:24+00:00)
Title: [API Improvement] Implement ToMessage for Command and Message and use ToMessage in Connection

Hello! I wanted to simplify the API of the send method to be simpler. I didn't like having to use .to_message after creating a command, so now the library does it. I was inspired by [ToSocketAddr](http://doc.rust-lang.org/std/io/net/ip/trait.ToSocketAddr.html) which allows you to convert a bunch of things into a `SocketAddr`. Essentially, `send` now takes a `ToMessage` trait, and anything can implement that. The old API isn't broken as long as `ToMessage` is imported (althought `to_message` is used twice).

```rust
// new way
c.send(NICK("bob"));
// old way, still works
c.send(NICK("bob").to_message());
```

Also sorry about the diff, my editor removed trailing white space here and there.