diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-11-01 18:06:31 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2014-01-04 14:44:12 -0800 |
| commit | 3b1862a82f04f8f5bcb197715d2ff506c6cdecc3 (patch) | |
| tree | 0057a02e6d56e9bea0357d649a420b6e66b5be71 /src/librustuv/lib.rs | |
| parent | 18cef3fad47f90c6c5ec1f2ad4dbc12b86b7ee7e (diff) | |
| download | rust-3b1862a82f04f8f5bcb197715d2ff506c6cdecc3.tar.gz rust-3b1862a82f04f8f5bcb197715d2ff506c6cdecc3.zip | |
Don't allow newtype structs to be dereferenced. #6246
Diffstat (limited to 'src/librustuv/lib.rs')
| -rw-r--r-- | src/librustuv/lib.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/librustuv/lib.rs b/src/librustuv/lib.rs index cff1d964579..ccfa5a51b6a 100644 --- a/src/librustuv/lib.rs +++ b/src/librustuv/lib.rs @@ -310,7 +310,8 @@ impl UvError { } pub fn is_eof(&self) -> bool { - **self == uvll::EOF + let UvError(handle) = *self; + handle == uvll::EOF } } @@ -331,10 +332,11 @@ pub fn uv_error_to_io_error(uverr: UvError) -> IoError { // Importing error constants // uv error descriptions are static - let c_desc = uvll::uv_strerror(*uverr); + let UvError(errcode) = uverr; + let c_desc = uvll::uv_strerror(errcode); let desc = str::raw::c_str_to_static_slice(c_desc); - let kind = match *uverr { + let kind = match errcode { uvll::UNKNOWN => io::OtherIoError, uvll::OK => io::OtherIoError, uvll::EOF => io::EndOfFile, |
