Skip to content

Commit 55f528f

Browse files
committed
auto merge of #9354 : thestinger/rust/cleanup, r=alexcrichton
I don't see the point of this function, and there are no users.
2 parents db78fdc + 807725b commit 55f528f

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)