diff options
| author | Kevin Butler <[email protected]> | 2015-02-20 21:04:01 +0000 |
|---|---|---|
| committer | Kevin Butler <[email protected]> | 2015-02-20 21:04:01 +0000 |
| commit | cb0e1688c8aa2e07a917851c829b24e4528d1282 (patch) | |
| tree | 6a9951abe98a6d8eabfbd1a5723ba561014e7491 /openssl/src/ssl/error.rs | |
| parent | Unique<T> now derefs to *mut T (diff) | |
| download | rust-openssl-cb0e1688c8aa2e07a917851c829b24e4528d1282.tar.xz rust-openssl-cb0e1688c8aa2e07a917851c829b24e4528d1282.zip | |
Update depreciated code
Diffstat (limited to 'openssl/src/ssl/error.rs')
| -rw-r--r-- | openssl/src/ssl/error.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/openssl/src/ssl/error.rs b/openssl/src/ssl/error.rs index a80c244e..bb2a5557 100644 --- a/openssl/src/ssl/error.rs +++ b/openssl/src/ssl/error.rs @@ -4,7 +4,7 @@ pub use self::OpensslError::*; use libc::c_ulong; use std::error; use std::fmt; -use std::ffi::c_str_to_bytes; +use std::ffi::CStr; use std::old_io::IoError; use ffi; @@ -75,21 +75,21 @@ pub enum OpensslError { fn get_lib(err: c_ulong) -> String { unsafe { - let bytes = c_str_to_bytes(&ffi::ERR_lib_error_string(err)).to_vec(); + let bytes = CStr::from_ptr(ffi::ERR_lib_error_string(err)).to_bytes().to_vec(); String::from_utf8(bytes).unwrap() } } fn get_func(err: c_ulong) -> String { unsafe { - let bytes = c_str_to_bytes(&ffi::ERR_func_error_string(err)).to_vec(); + let bytes = CStr::from_ptr(ffi::ERR_func_error_string(err)).to_bytes().to_vec(); String::from_utf8(bytes).unwrap() } } fn get_reason(err: c_ulong) -> String { unsafe { - let bytes = c_str_to_bytes(&ffi::ERR_reason_error_string(err)).to_vec(); + let bytes = CStr::from_ptr(ffi::ERR_reason_error_string(err)).to_bytes().to_vec(); String::from_utf8(bytes).unwrap() } } |