Skip to content

Commit 6b22c09

Browse files
committed
make util::NonCopyable a unit struct instead of a struct with a unit
1 parent 84bed97 commit 6b22c09

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/libstd/util.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,11 @@ pub fn replace<T>(dest: &mut T, mut src: T) -> T {
7575
}
7676

7777
/// A non-copyable dummy type.
78-
pub struct NonCopyable {
79-
priv i: (),
80-
}
78+
pub struct NonCopyable;
8179

8280
impl NonCopyable {
8381
/// Creates a dummy non-copyable structure and returns it for use.
84-
pub fn new() -> NonCopyable { NonCopyable { i: () } }
82+
pub fn new() -> NonCopyable { NonCopyable }
8583
}
8684

8785
impl Drop for NonCopyable {

0 commit comments

Comments
 (0)