Skip to content

Commit fa05862

Browse files
committed
Auto merge of #7033 - lzutao:fmt-workspace, r=alexcrichton
ci: Run cargo fmt on all workspaces
2 parents bdacee4 + b01f595 commit fa05862

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

.travis.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
language: rust
22
rust: stable
3-
sudo: required
43
dist: trusty
54

65
git:
76
depth: 1
87

98
matrix:
109
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+
1118
- env: TARGET=x86_64-unknown-linux-gnu
1219
ALT=i686-unknown-linux-gnu
1320
if: branch != master OR type = pull_request

tests/testsuite/support/paths.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,16 @@ thread_local! {
5151
}
5252

5353
pub struct TestIdGuard {
54-
_private: ()
54+
_private: (),
5555
}
5656

5757
pub fn init_root() -> TestIdGuard {
5858
static NEXT_ID: AtomicUsize = AtomicUsize::new(0);
5959

6060
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));
6262

63-
let guard = TestIdGuard {
64-
_private: ()
65-
};
63+
let guard = TestIdGuard { _private: () };
6664

6765
root().mkdir_p();
6866

@@ -71,15 +69,17 @@ pub fn init_root() -> TestIdGuard {
7169

7270
impl Drop for TestIdGuard {
7371
fn drop(&mut self) {
74-
TEST_ID.with(|n| { *n.borrow_mut() = None } );
72+
TEST_ID.with(|n| *n.borrow_mut() = None);
7573
}
7674
}
7775

7876
pub fn root() -> PathBuf {
7977
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+
});
8383
GLOBAL_ROOT.join(&format!("t{}", id))
8484
}
8585

0 commit comments

Comments
 (0)