Implemented Display for Message.

This commit is contained in:
Aaron Weiss 2016-03-17 21:39:58 -04:00
parent e4495940fc
commit 863946ecb8
5 changed files with 11 additions and 4 deletions

View file

@ -1,5 +1,6 @@
//! Messages to and from the server.
use std::borrow::ToOwned;
use std::fmt::{Display, Formatter, Result as FmtResult};
use std::io::{Result as IoResult};
use std::str::FromStr;
use client::data::Command;
@ -119,6 +120,12 @@ impl<'a> From<&'a str> for Message {
}
}
impl Display for Message {
fn fmt(&self, f: &mut Formatter) -> FmtResult {
write!(f, "{}", self.to_string())
}
}
/// A message tag as defined by [IRCv3.2](http://ircv3.net/specs/core/message-tags-3.2.html).
#[derive(Clone, PartialEq, Debug)]
pub struct Tag(String, Option<String>);