Skip to content

Commit 0cc6cef

Browse files
committed
Add util::ignore
1 parent efea6f0 commit 0cc6cef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libcore/util.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
/// The identity function.
66
pure fn id<T>(+x: T) -> T { x }
77

8+
/// Ignores a value.
9+
pure fn ignore<T>(+_x: T) { }
10+
811
/**
912
* Swap the values at two mutable locations of the same type, without
1013
* deinitialising or copying either one.

0 commit comments

Comments
 (0)