File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 1
1
language : rust
2
2
rust : stable
3
- sudo : required
4
3
dist : trusty
5
4
6
5
git :
7
6
depth : 1
8
7
9
8
matrix :
10
9
include :
10
+ - name : " rustfmt"
11
+ env : TARGET=x86_64-unknown-linux-gnu
12
+ rust : stable
13
+ before_script :
14
+ - rustup component add rustfmt
15
+ script :
16
+ - cargo fmt --all -- --check
17
+
11
18
- env : TARGET=x86_64-unknown-linux-gnu
12
19
ALT=i686-unknown-linux-gnu
13
20
if : branch != master OR type = pull_request
Original file line number Diff line number Diff line change @@ -51,18 +51,16 @@ thread_local! {
51
51
}
52
52
53
53
pub struct TestIdGuard {
54
- _private : ( )
54
+ _private : ( ) ,
55
55
}
56
56
57
57
pub fn init_root ( ) -> TestIdGuard {
58
58
static NEXT_ID : AtomicUsize = AtomicUsize :: new ( 0 ) ;
59
59
60
60
let id = NEXT_ID . fetch_add ( 1 , Ordering :: Relaxed ) ;
61
- TEST_ID . with ( |n| { * n. borrow_mut ( ) = Some ( id) } ) ;
61
+ TEST_ID . with ( |n| * n. borrow_mut ( ) = Some ( id) ) ;
62
62
63
- let guard = TestIdGuard {
64
- _private : ( )
65
- } ;
63
+ let guard = TestIdGuard { _private : ( ) } ;
66
64
67
65
root ( ) . mkdir_p ( ) ;
68
66
@@ -71,15 +69,17 @@ pub fn init_root() -> TestIdGuard {
71
69
72
70
impl Drop for TestIdGuard {
73
71
fn drop ( & mut self ) {
74
- TEST_ID . with ( |n| { * n. borrow_mut ( ) = None } ) ;
72
+ TEST_ID . with ( |n| * n. borrow_mut ( ) = None ) ;
75
73
}
76
74
}
77
75
78
76
pub fn root ( ) -> PathBuf {
79
77
let id = TEST_ID . with ( |n| {
80
- n. borrow ( ) . expect ( "Tests must use the `#[cargo_test]` attribute in \
81
- order to be able to use the crate root.")
82
- } ) ;
78
+ n. borrow ( ) . expect (
79
+ "Tests must use the `#[cargo_test]` attribute in \
80
+ order to be able to use the crate root.",
81
+ )
82
+ } ) ;
83
83
GLOBAL_ROOT . join ( & format ! ( "t{}" , id) )
84
84
}
85
85
You can’t perform that action at this time.
0 commit comments