]> git.lizzy.rs Git - rust.git/commitdiff
make util::NonCopyable a unit struct instead of a struct with a unit
authorBen Blum <bblum@andrew.cmu.edu>
Tue, 11 Jun 2013 00:30:01 +0000 (20:30 -0400)
committerBen Blum <bblum@andrew.cmu.edu>
Thu, 13 Jun 2013 00:53:40 +0000 (20:53 -0400)
src/libstd/util.rs

index 376ead608bc0659326ab9266e394de9fc911653a..61c284f580c0feebb43114b61b4bd0e4a7bcbfd4 100644 (file)
@@ -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 {