rustup: changes to io::Error

This commit is contained in:
Sean McArthur 2015-04-02 11:01:22 -07:00
parent 121a667f9b
commit 24b876521b
5 changed files with 6 additions and 9 deletions

View File

@ -1,7 +1,6 @@
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] #![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
#![allow(dead_code)] #![allow(dead_code)]
#![doc(html_root_url="https://sfackler.github.io/rust-openssl/doc/openssl-sys")] #![doc(html_root_url="https://sfackler.github.io/rust-openssl/doc/openssl-sys")]
#![feature(convert)]
extern crate libc; extern crate libc;

View File

@ -71,8 +71,7 @@ impl Read for MemBio {
Ok(0) Ok(0)
} else { } else {
Err(io::Error::new(io::ErrorKind::Other, Err(io::Error::new(io::ErrorKind::Other,
"MemBio read error", SslError::get()))
Some(format!("{:?}", SslError::get()))))
} }
} else { } else {
Ok(ret as usize) Ok(ret as usize)
@ -89,8 +88,7 @@ impl Write for MemBio {
if ret < 0 { if ret < 0 {
Err(io::Error::new(io::ErrorKind::Other, Err(io::Error::new(io::ErrorKind::Other,
"MemBio write error", SslError::get()))
Some(format!("{:?}", SslError::get()))))
} else { } else {
Ok(ret as usize) Ok(ret as usize)
} }

View File

@ -1,4 +1,4 @@
#![feature(core, io, std_misc, unique, collections)] #![feature(core, std_misc, unique)]
#![doc(html_root_url="https://sfackler.github.io/rust-openssl/doc/openssl")] #![doc(html_root_url="https://sfackler.github.io/rust-openssl/doc/openssl")]
#[macro_use] #[macro_use]

View File

@ -10,7 +10,7 @@ use std::io;
use ffi; use ffi;
/// An SSL error /// An SSL error
#[derive(Debug, Clone, PartialEq, Eq)] #[derive(Debug)]
pub enum SslError { pub enum SslError {
/// The underlying stream reported an error /// The underlying stream reported an error
StreamError(io::Error), StreamError(io::Error),

View File

@ -808,7 +808,7 @@ impl<S: Read+Write> Read for SslStream<S> {
Err(SslSessionClosed) => Ok(0), Err(SslSessionClosed) => Ok(0),
Err(StreamError(e)) => Err(e), Err(StreamError(e)) => Err(e),
Err(e @ OpenSslErrors(_)) => { Err(e @ OpenSslErrors(_)) => {
Err(io::Error::new(io::ErrorKind::Other, "OpenSSL error", Some(format!("{}", e)))) Err(io::Error::new(io::ErrorKind::Other, e))
} }
} }
} }
@ -821,7 +821,7 @@ impl<S: Read+Write> Write for SslStream<S> {
Err(SslSessionClosed) => Ok(0), Err(SslSessionClosed) => Ok(0),
Err(StreamError(e)) => return Err(e), Err(StreamError(e)) => return Err(e),
Err(e @ OpenSslErrors(_)) => { Err(e @ OpenSslErrors(_)) => {
Err(io::Error::new(io::ErrorKind::Other, "OpenSSL error", Some(format!("{}", e)))) Err(io::Error::new(io::ErrorKind::Other, e))
} }
} }
} }