blob: 16efff55b06608e168264f1466b3a2d3acf69da5 [file] [log] [blame]
topecongirofaa5a102018-04-30 16:22:28 +09001// rustfmt-reorder_impl_items: true
2
Matthias Krügerb25f9742018-10-19 00:44:14 +02003// The ordering of the following impl items should be idempotent.
topecongirofaa5a102018-04-30 16:22:28 +09004impl<'a> Command<'a> {
5 pub fn send_to(&self, w: &mut io::Write) -> io::Result<()> {
6 match self {
7 &Command::Data(ref c) => c.send_to(w),
8 &Command::Vrfy(ref c) => c.send_to(w),
9 }
10 }
11
12 pub fn parse(arg: &[u8]) -> Result<Command, ParseError> {
13 nom_to_result(command(arg))
14 }
15}