Skip to content

Commit 807725b

Browse files
committed
util: remove unused with function
1 parent 407d179 commit 807725b

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/libstd/util.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,6 @@ pub fn id<T>(x: T) -> T { x }
2323
#[inline]
2424
pub fn ignore<T>(_x: T) { }
2525

26-
/// Sets `*ptr` to `new_value`, invokes `op()`, and then restores the
27-
/// original value of `*ptr`.
28-
///
29-
/// NB: This function accepts `@mut T` and not `&mut T` to avoid
30-
/// an obvious borrowck hazard. Typically passing in `&mut T` will
31-
/// cause borrow check errors because it freezes whatever location
32-
/// that `&mut T` is stored in (either statically or dynamically).
33-
#[inline]
34-
pub fn with<T,R>(
35-
ptr: @mut T,
36-
value: T,
37-
op: &fn() -> R) -> R
38-
{
39-
let prev = replace(ptr, value);
40-
let result = op();
41-
*ptr = prev;
42-
return result;
43-
}
44-
4526
/**
4627
* Swap the values at two mutable locations of the same type, without
4728
* deinitialising or copying either one.

0 commit comments

Comments
 (0)