diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-09-03 09:49:50 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-09-03 09:49:50 +0300 |
| commit | 06fb196256bbab1e7aa4f43daf45321efaa6e0eb (patch) | |
| tree | 23863826af019b2bc07d295882e092d244c36699 /src/libstd/io | |
| parent | 3903ea96f557dc923cf73d3905554083cd921a01 (diff) | |
| download | rust-06fb196256bbab1e7aa4f43daf45321efaa6e0eb.tar.gz rust-06fb196256bbab1e7aa4f43daf45321efaa6e0eb.zip | |
Use `null()`/`null_mut()` instead of `0 as *const T`/`0 as *mut T`
Diffstat (limited to 'src/libstd/io')
| -rw-r--r-- | src/libstd/io/lazy.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstd/io/lazy.rs b/src/libstd/io/lazy.rs index c3e309d182b..ad17a650336 100644 --- a/src/libstd/io/lazy.rs +++ b/src/libstd/io/lazy.rs @@ -11,6 +11,7 @@ use prelude::v1::*; use cell::Cell; +use ptr; use rt; use sync::{StaticMutex, Arc}; @@ -26,7 +27,7 @@ impl<T: Send + Sync + 'static> Lazy<T> { pub const fn new(init: fn() -> Arc<T>) -> Lazy<T> { Lazy { lock: StaticMutex::new(), - ptr: Cell::new(0 as *mut _), + ptr: Cell::new(ptr::null_mut()), init: init } } |
