Adding some comments and cleaning up imports
This commit is contained in:
parent
aa989ce0e5
commit
56edd6c46b
2 changed files with 10 additions and 7 deletions
|
|
@ -1,7 +1,6 @@
|
|||
use std::net::{TcpStream, ToSocketAddrs};
|
||||
use openssl::ssl::{SslContext, SslStream};
|
||||
use std::io::{Read, Write};
|
||||
use std::io::{self};
|
||||
use std::io::{self, Read, Write};
|
||||
|
||||
use super::mailbox::Mailbox;
|
||||
use super::parse::{parse_response_ok, parse_capability, parse_select_or_examine};
|
||||
|
|
|
|||
14
src/error.rs
14
src/error.rs
|
|
@ -1,6 +1,6 @@
|
|||
use std::io::{self};
|
||||
use std::io::Error as IoError;
|
||||
use std::result;
|
||||
use std::fmt::{self};
|
||||
use std::fmt;
|
||||
use std::error::Error as StdError;
|
||||
|
||||
use openssl::ssl::error::SslError;
|
||||
|
|
@ -10,14 +10,18 @@ pub type Result<T> = result::Result<T, Error>;
|
|||
/// A set of errors that can occur in the IMAP client
|
||||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
Io(io::Error),
|
||||
/// An `io::Error` that occurred while trying to read or write to a network stream.
|
||||
Io(IoError),
|
||||
/// An error from the `openssl` library.
|
||||
Ssl(SslError),
|
||||
/// A BAD response from the IMAP server.
|
||||
BadResponse(Vec<String>),
|
||||
/// A NO response from the IMAP server.
|
||||
NoResponse(Vec<String>),
|
||||
}
|
||||
|
||||
impl From<io::Error> for Error {
|
||||
fn from(err: io::Error) -> Error {
|
||||
impl From<IoError> for Error {
|
||||
fn from(err: IoError) -> Error {
|
||||
Error::Io(err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue