File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 1
- use core :: mem:: ManuallyDrop ;
2
- use core :: ops:: { Deref , DerefMut } ;
3
- use core :: ptr;
1
+ use crate :: mem:: ManuallyDrop ;
2
+ use crate :: ops:: { Deref , DerefMut } ;
3
+ use crate :: ptr;
4
4
5
5
/// Wrap a value and run a closure when dropped.
6
6
///
52
52
/// ```
53
53
#[ unstable( feature = "drop_guard" , issue = "none" ) ]
54
54
pub fn new ( inner : T , f : F ) -> Self {
55
- Self {
56
- inner : ManuallyDrop :: new ( inner) ,
57
- f : ManuallyDrop :: new ( f) ,
58
- }
55
+ Self { inner : ManuallyDrop :: new ( inner) , f : ManuallyDrop :: new ( f) }
59
56
}
60
57
61
58
/// Consumes the `Guard`, returning the wrapped value.
@@ -141,8 +138,9 @@ where
141
138
// tests copied from https://docs.rs/scopeguard/latest/src/scopeguard/lib.rs.html#1-595
142
139
#[ cfg( test) ]
143
140
mod tests {
141
+ use crate :: cell:: Cell ;
142
+
144
143
use super :: * ;
145
- use std:: cell:: Cell ;
146
144
147
145
#[ test]
148
146
fn test_only_dropped_by_closure_when_run ( ) {
You can’t perform that action at this time.
0 commit comments