Skip to content

Commit 01ac54c

Browse files
committed
Run tidy on tests
1 parent e7cb5e3 commit 01ac54c

File tree

6 files changed

+45
-27
lines changed

6 files changed

+45
-27
lines changed

std/tests/builtin-clone.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn test_clone<T: Clone>(arg: T) {
66
let _ = arg.clone();
77
}
88

9-
fn foo() { }
9+
fn foo() {}
1010

1111
#[derive(Debug, PartialEq, Eq)]
1212
struct S(i32);
@@ -27,19 +27,7 @@ fn builtin_clone() {
2727
let b = [S(1), S(2), S(3)];
2828
assert_eq!(b, a.clone());
2929

30-
let a = (
31-
(S(1), S(0)),
32-
(
33-
(S(0), S(0), S(1)),
34-
S(0)
35-
)
36-
);
37-
let b = (
38-
(S(2), S(1)),
39-
(
40-
(S(1), S(1), S(2)),
41-
S(1)
42-
)
43-
);
30+
let a = ((S(1), S(0)), ((S(0), S(0), S(1)), S(0)));
31+
let b = ((S(2), S(1)), ((S(1), S(1), S(2)), S(1)));
4432
assert_eq!(b, a.clone());
4533
}

std/tests/eq-multidispatch.rs

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,35 @@ struct Foo;
77
#[derive(Debug)]
88
struct Fu;
99

10-
impl PartialEq for Baz { fn eq(&self, _: &Baz) -> bool { true } }
10+
impl PartialEq for Baz {
11+
fn eq(&self, _: &Baz) -> bool {
12+
true
13+
}
14+
}
15+
16+
impl PartialEq<Fu> for Foo {
17+
fn eq(&self, _: &Fu) -> bool {
18+
true
19+
}
20+
}
1121

12-
impl PartialEq<Fu> for Foo { fn eq(&self, _: &Fu) -> bool { true } }
13-
impl PartialEq<Foo> for Fu { fn eq(&self, _: &Foo) -> bool { true } }
22+
impl PartialEq<Foo> for Fu {
23+
fn eq(&self, _: &Foo) -> bool {
24+
true
25+
}
26+
}
1427

15-
impl PartialEq<Bar> for Foo { fn eq(&self, _: &Bar) -> bool { false } }
16-
impl PartialEq<Foo> for Bar { fn eq(&self, _: &Foo) -> bool { false } }
28+
impl PartialEq<Bar> for Foo {
29+
fn eq(&self, _: &Bar) -> bool {
30+
false
31+
}
32+
}
33+
34+
impl PartialEq<Foo> for Bar {
35+
fn eq(&self, _: &Foo) -> bool {
36+
false
37+
}
38+
}
1739

1840
#[test]
1941
fn eq_multidispatch() {

std/tests/issue-21058.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
use std::fmt::Debug;
44

55
struct NT(str);
6-
struct DST { a: u32, b: str }
6+
7+
struct DST {
8+
a: u32,
9+
b: str,
10+
}
711

812
macro_rules! check {
913
(val: $ty_of:expr, $expected:expr) => {
@@ -56,7 +60,9 @@ fn type_name_of_val<T>(_: T) -> &'static str {
5660
struct Foo;
5761

5862
impl Foo {
59-
fn new() -> Self { Foo }
63+
fn new() -> Self {
64+
Foo
65+
}
6066
}
6167

6268
fn foo() -> impl Debug {

std/tests/istr.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ fn test_stack_assign() {
99
}
1010

1111
#[test]
12-
fn test_heap_lit() { "a big string".to_string(); }
12+
fn test_heap_lit() {
13+
"a big string".to_string();
14+
}
1315

1416
#[test]
1517
fn test_heap_assign() {

std/tests/log-knows-the-names-of-variants-in-std.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#[derive(Clone, Debug)]
55
enum foo {
6-
a(usize),
7-
b(String),
6+
a(usize),
7+
b(String),
88
}
99

1010
fn check_log<T: std::fmt::Debug>(exp: String, v: T) {

std/tests/minmax-stability-issue-23687.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use std::fmt::Debug;
21
use std::cmp::{self, Ordering};
2+
use std::fmt::Debug;
33

44
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
55
struct Foo {
66
n: u8,
7-
name: &'static str
7+
name: &'static str,
88
}
99

1010
impl PartialOrd for Foo {

0 commit comments

Comments
 (0)