diff options
| author | Ben Blum <bblum@andrew.cmu.edu> | 2013-06-10 20:30:01 -0400 |
|---|---|---|
| committer | Ben Blum <bblum@andrew.cmu.edu> | 2013-06-12 20:53:40 -0400 |
| commit | 6b22c090a5492448e5ef2992745725199851f0fe (patch) | |
| tree | 793ccc8f324808f50c0ef57ba286145651a24109 /src/libstd | |
| parent | 84bed9769b5d15871481b657860ad6a7d0a62f42 (diff) | |
| download | rust-6b22c090a5492448e5ef2992745725199851f0fe.tar.gz rust-6b22c090a5492448e5ef2992745725199851f0fe.zip | |
make util::NonCopyable a unit struct instead of a struct with a unit
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/util.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libstd/util.rs b/src/libstd/util.rs index 376ead608bc..61c284f580c 100644 --- a/src/libstd/util.rs +++ b/src/libstd/util.rs @@ -75,13 +75,11 @@ pub fn replace<T>(dest: &mut T, mut src: T) -> T { } /// A non-copyable dummy type. -pub struct NonCopyable { - priv i: (), -} +pub struct NonCopyable; impl NonCopyable { /// Creates a dummy non-copyable structure and returns it for use. - pub fn new() -> NonCopyable { NonCopyable { i: () } } + pub fn new() -> NonCopyable { NonCopyable } } impl Drop for NonCopyable { |
