2018-04-30 16:22:28 +09:00
|
|
|
// rustfmt-reorder_impl_items: true
|
|
|
|
|
2018-10-19 00:44:14 +02:00
|
|
|
// The ordering of the following impl items should be idempotent.
|
2018-04-30 16:22:28 +09:00
|
|
|
impl<'a> Command<'a> {
|
|
|
|
pub fn send_to(&self, w: &mut io::Write) -> io::Result<()> {
|
|
|
|
match self {
|
|
|
|
&Command::Data(ref c) => c.send_to(w),
|
|
|
|
&Command::Vrfy(ref c) => c.send_to(w),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn parse(arg: &[u8]) -> Result<Command, ParseError> {
|
|
|
|
nom_to_result(command(arg))
|
|
|
|
}
|
|
|
|
}
|