Expose run_command

This commit is contained in:
Artem 2015-11-05 13:43:52 +03:00
parent 2fd5a4224a
commit fbb4b23f75

View file

@ -222,14 +222,14 @@ impl IMAPStream {
self.run_command_and_check_ok(&format!("COPY {} {}", sequence_set, mailbox_name).to_string()) self.run_command_and_check_ok(&format!("COPY {} {}", sequence_set, mailbox_name).to_string())
} }
fn run_command_and_check_ok(&mut self, command: &str) -> Result<()> { pub fn run_command_and_check_ok(&mut self, command: &str) -> Result<()> {
match self.run_command(command) { match self.run_command(command) {
Ok(lines) => IMAPStream::parse_response_ok(lines), Ok(lines) => IMAPStream::parse_response_ok(lines),
Err(e) => Err(e) Err(e) => Err(e)
} }
} }
fn run_command(&mut self, untagged_command: &str) -> Result<Vec<String>> { pub fn run_command(&mut self, untagged_command: &str) -> Result<Vec<String>> {
let command = self.create_command(untagged_command.to_string()); let command = self.create_command(untagged_command.to_string());
match self.write_str(&*command) { match self.write_str(&*command) {