Skip to content

Commit 96e3c8a

Browse files
committed
chore: run cargo fmt
1 parent 1146b6b commit 96e3c8a

28 files changed

Lines changed: 200 additions & 125 deletions

File tree

src/bigdecimal/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::prelude::*;
2-
use bigdecimal::num_bigint::BigInt;
32
use bigdecimal::BigDecimal;
3+
use bigdecimal::num_bigint::BigInt;
44

55
#[test]
66
fn bigdecimal_is_equal_to_other() {

src/boolean/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use crate::assertions::AssertBoolean;
44
use crate::colored::{mark_missing, mark_unexpected};
5-
use crate::expectations::{is_false, is_true, IsFalse, IsTrue};
5+
use crate::expectations::{IsFalse, IsTrue, is_false, is_true};
66
use crate::spec::{DiffFormat, Expectation, Expression, FailingStrategy, Invertible, Spec};
77
use crate::std::format;
88
use crate::std::string::String;

src/char/mod.rs

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use crate::assertions::AssertChar;
22
use crate::colored::{mark_missing_string, mark_unexpected_char};
33
use crate::expectations::{
4-
is_alphabetic, is_alphanumeric, is_ascii, is_control_char, is_digit, is_lower_case,
5-
is_upper_case, is_whitespace, IsAlphabetic, IsAlphanumeric, IsAscii, IsControlChar, IsDigit,
6-
IsLowerCase, IsUpperCase, IsWhitespace,
4+
IsAlphabetic, IsAlphanumeric, IsAscii, IsControlChar, IsDigit, IsLowerCase, IsUpperCase,
5+
IsWhitespace, is_alphabetic, is_alphanumeric, is_ascii, is_control_char, is_digit,
6+
is_lower_case, is_upper_case, is_whitespace,
77
};
88
use crate::spec::{DiffFormat, Expectation, Expression, FailingStrategy, Invertible, Spec};
99
use crate::std::format;
@@ -102,7 +102,9 @@ impl Expectation<char> for IsLowerCase {
102102
};
103103
let marked_actual = mark_unexpected_char(*actual, format);
104104
let marked_expected = mark_missing_string(&expected, format);
105-
format!("expected {expression} to be {not}lowercase\n but was: {marked_actual}\n expected: {marked_expected}")
105+
format!(
106+
"expected {expression} to be {not}lowercase\n but was: {marked_actual}\n expected: {marked_expected}"
107+
)
106108
}
107109
}
108110

@@ -143,7 +145,9 @@ impl Expectation<char> for IsUpperCase {
143145
};
144146
let marked_actual = mark_unexpected_char(*actual, format);
145147
let marked_expected = mark_missing_string(&expected, format);
146-
format!("expected {expression} to be {not}uppercase\n but was: {marked_actual}\n expected: {marked_expected}")
148+
format!(
149+
"expected {expression} to be {not}uppercase\n but was: {marked_actual}\n expected: {marked_expected}"
150+
)
147151
}
148152
}
149153

@@ -179,7 +183,9 @@ impl Expectation<char> for IsAscii {
179183
) -> String {
180184
let not = if inverted { "not " } else { "" };
181185
let marked_actual = mark_unexpected_char(*actual, format);
182-
format!("expected {expression} to be {not}an ASCII character\n but was: {marked_actual}\n expected: {not}an ASCII character")
186+
format!(
187+
"expected {expression} to be {not}an ASCII character\n but was: {marked_actual}\n expected: {not}an ASCII character"
188+
)
183189
}
184190
}
185191

@@ -215,7 +221,9 @@ impl Expectation<char> for IsAlphabetic {
215221
) -> String {
216222
let not = if inverted { "not " } else { "" };
217223
let marked_actual = mark_unexpected_char(*actual, format);
218-
format!("expected {expression} to be {not}an alphabetic character\n but was: {marked_actual}\n expected: {not}an alphabetic character")
224+
format!(
225+
"expected {expression} to be {not}an alphabetic character\n but was: {marked_actual}\n expected: {not}an alphabetic character"
226+
)
219227
}
220228
}
221229

@@ -251,7 +259,9 @@ impl Expectation<char> for IsAlphanumeric {
251259
) -> String {
252260
let not = if inverted { "not " } else { "" };
253261
let marked_actual = mark_unexpected_char(*actual, format);
254-
format!("expected {expression} to be {not}an alphanumeric character\n but was: {marked_actual}\n expected: {not}an alphanumeric character")
262+
format!(
263+
"expected {expression} to be {not}an alphanumeric character\n but was: {marked_actual}\n expected: {not}an alphanumeric character"
264+
)
255265
}
256266
}
257267

@@ -287,7 +297,9 @@ impl Expectation<char> for IsControlChar {
287297
) -> String {
288298
let not = if inverted { "not " } else { "" };
289299
let marked_actual = mark_unexpected_char(*actual, format);
290-
format!("expected {expression} to be {not}a control character\n but was: {marked_actual}\n expected: {not}a control character")
300+
format!(
301+
"expected {expression} to be {not}a control character\n but was: {marked_actual}\n expected: {not}a control character"
302+
)
291303
}
292304
}
293305

@@ -324,7 +336,9 @@ impl Expectation<char> for IsDigit {
324336
let not = if inverted { "not " } else { "" };
325337
let radix = self.radix;
326338
let marked_actual = mark_unexpected_char(*actual, format);
327-
format!("expected {expression} to be {not}a digit in the radix {radix}\n but was: {marked_actual}\n expected: {not}a digit in the radix {radix}")
339+
format!(
340+
"expected {expression} to be {not}a digit in the radix {radix}\n but was: {marked_actual}\n expected: {not}a digit in the radix {radix}"
341+
)
328342
}
329343
}
330344

@@ -360,7 +374,9 @@ impl Expectation<char> for IsWhitespace {
360374
) -> String {
361375
let not = if inverted { "not " } else { "" };
362376
let marked_actual = mark_unexpected_char(*actual, format);
363-
format!("expected {expression} to be {not}whitespace\n but was: {marked_actual}\n expected: {not}whitespace")
377+
format!(
378+
"expected {expression} to be {not}whitespace\n but was: {marked_actual}\n expected: {not}whitespace"
379+
)
364380
}
365381
}
366382

src/char_count.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
use crate::assertions::AssertHasCharCount;
44
use crate::colored::{mark_missing, mark_unexpected};
55
use crate::expectations::{
6-
has_at_least_char_count, has_at_most_char_count, has_char_count, has_char_count_greater_than,
7-
has_char_count_in_range, has_char_count_less_than, HasAtLeastCharCount, HasAtMostCharCount,
8-
HasCharCount, HasCharCountGreaterThan, HasCharCountInRange, HasCharCountLessThan,
6+
HasAtLeastCharCount, HasAtMostCharCount, HasCharCount, HasCharCountGreaterThan,
7+
HasCharCountInRange, HasCharCountLessThan, has_at_least_char_count, has_at_most_char_count,
8+
has_char_count, has_char_count_greater_than, has_char_count_in_range, has_char_count_less_than,
99
};
1010
use crate::properties::CharCountProperty;
1111
use crate::spec::{DiffFormat, Expectation, Expression, FailingStrategy, Spec};

src/collection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
33
use crate::properties::{DefinedOrderProperty, IsEmptyProperty, LengthProperty};
44
use crate::std::collections::{
5-
btree_map, btree_set, linked_list, vec_deque, BTreeMap, BTreeSet, BinaryHeap, LinkedList,
6-
VecDeque,
5+
BTreeMap, BTreeSet, BinaryHeap, LinkedList, VecDeque, btree_map, btree_set, linked_list,
6+
vec_deque,
77
};
88
use crate::std::{array, slice};
99
use crate::std::{vec, vec::Vec};

src/colored/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
#[cfg(feature = "colored")]
4848
#[cfg_attr(docsrs, doc(cfg(feature = "colored")))]
4949
pub use with_colored_feature::{
50-
diff_format_for_mode, DIFF_FORMAT_BOLD, DIFF_FORMAT_RED_BLUE, DIFF_FORMAT_RED_GREEN,
51-
DIFF_FORMAT_RED_YELLOW,
50+
DIFF_FORMAT_BOLD, DIFF_FORMAT_RED_BLUE, DIFF_FORMAT_RED_GREEN, DIFF_FORMAT_RED_YELLOW,
51+
diff_format_for_mode,
5252
};
5353

5454
use crate::spec::{DiffFormat, Highlight};

src/colored/tests.rs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,15 @@ mod with_colored_feature {
5959
}))
6060
.display_failures();
6161

62-
assert_eq!(failures, &[
63-
"expected subject to be equal to Some(Foo { lorem: \"Hello World!\", ipsum: 42, dolor: Some(\"hey ho!\") })\n \
62+
assert_eq!(
63+
failures,
64+
&[
65+
"expected subject to be equal to Some(Foo { lorem: \"Hello World!\", ipsum: 42, dolor: Some(\"hey ho!\") })\n \
6466
but was: Some(Foo { lorem: \"\u{1b}[31m¡\u{1b}[0mH\u{1b}[31mo\u{1b}[0ml\u{1b}[31ma,\u{1b}[0m W\u{1b}[31me\u{1b}[0ml\u{1b}[31mt\u{1b}[0m!\", ipsum: 42, dolor: Some(\"hey\") })\n \
6567
expected: Some(Foo { lorem: \"H\u{1b}[32me\u{1b}[0ml\u{1b}[32mlo\u{1b}[0m W\u{1b}[32mor\u{1b}[0ml\u{1b}[32md\u{1b}[0m!\", ipsum: 42, dolor: Some(\"hey\u{1b}[32m ho!\u{1b}[0m\") })\n\
6668
",
67-
]);
69+
]
70+
);
6871
}
6972

7073
#[test]
@@ -136,8 +139,8 @@ mod with_colored_feature {
136139
}
137140

138141
#[test]
139-
fn mark_unexpected_substring_in_string_highlights_nothing_if_the_string_does_not_contain_the_substring(
140-
) {
142+
fn mark_unexpected_substring_in_string_highlights_nothing_if_the_string_does_not_contain_the_substring()
143+
{
141144
let marked_string = mark_unexpected_substring_in_string(
142145
"mollit est eu amet",
143146
"st eux a",
@@ -159,8 +162,8 @@ mod with_colored_feature {
159162
}
160163

161164
#[test]
162-
fn mark_missing_substring_in_string_highlights_nothing_if_the_string_does_not_contain_the_substring(
163-
) {
165+
fn mark_missing_substring_in_string_highlights_nothing_if_the_string_does_not_contain_the_substring()
166+
{
164167
let marked_string = mark_missing_substring_in_string(
165168
"mollit est eu amet",
166169
"xt est eu",
@@ -171,8 +174,8 @@ mod with_colored_feature {
171174
}
172175

173176
#[test]
174-
fn mark_unexpected_char_in_string_highlights_all_occurences_of_a_char_within_a_string_as_unexpected(
175-
) {
177+
fn mark_unexpected_char_in_string_highlights_all_occurences_of_a_char_within_a_string_as_unexpected()
178+
{
176179
let marked_string =
177180
mark_unexpected_char_in_string("zzril mazim sint", 'z', &DIFF_FORMAT_RED_YELLOW);
178181

@@ -181,8 +184,8 @@ mod with_colored_feature {
181184
}
182185

183186
#[test]
184-
fn mark_unexpected_char_in_string_highlights_nothing_if_the_string_does_not_contain_the_character(
185-
) {
187+
fn mark_unexpected_char_in_string_highlights_nothing_if_the_string_does_not_contain_the_character()
188+
{
186189
let marked_string =
187190
mark_unexpected_char_in_string("zzril mazim sint", 'v', &DIFF_FORMAT_RED_YELLOW);
188191

src/equality.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use crate::assertions::{
55
};
66
use crate::colored::{mark_diff, mark_diff_str};
77
use crate::expectations::{
8-
has_debug_string, has_display_string, is_equal_to, is_same_as, not, HasDebugString,
9-
HasDisplayString, IsEqualTo, IsSameAs,
8+
HasDebugString, HasDisplayString, IsEqualTo, IsSameAs, has_debug_string, has_display_string,
9+
is_equal_to, is_same_as, not,
1010
};
1111
use crate::spec::{DiffFormat, Expectation, Expression, FailingStrategy, Invertible, Spec};
1212
use crate::std::fmt::{Debug, Display};

src/error/mod.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::assertions::AssertErrorHasSource;
22
use crate::colored::{mark_missing, mark_missing_string, mark_unexpected, mark_unexpected_string};
33
use crate::expectations::{
4-
error_has_source, error_has_source_message, not, ErrorHasSource, ErrorHasSourceMessage,
4+
ErrorHasSource, ErrorHasSourceMessage, error_has_source, error_has_source_message, not,
55
};
66
use crate::spec::{DiffFormat, Expectation, Expression, FailingStrategy, Invertible, Spec};
77
use crate::std::error::Error;
@@ -52,7 +52,9 @@ where
5252
};
5353
let marked_actual = mark_unexpected(actual, format);
5454
let marked_expected = mark_missing_string(expected, format);
55-
format!("expected {expression} to have {a} source\n but was: {marked_actual}\n expected: {marked_expected}")
55+
format!(
56+
"expected {expression} to have {a} source\n but was: {marked_actual}\n expected: {marked_expected}"
57+
)
5658
}
5759
}
5860

@@ -80,12 +82,16 @@ where
8082
if let Some(actual_source) = actual.source() {
8183
let marked_actual = mark_unexpected_string(&actual_source.to_string(), format);
8284
let marked_expected = mark_missing_string(expected, format);
83-
format!("expected {expression} to have a source message {not}equal to \"{expected}\"\n but was: \"{marked_actual}\"\n expected: \"{marked_expected}\"")
85+
format!(
86+
"expected {expression} to have a source message {not}equal to \"{expected}\"\n but was: \"{marked_actual}\"\n expected: \"{marked_expected}\""
87+
)
8488
} else {
8589
let mut marked_actual = mark_unexpected(actual, format);
8690
marked_actual.push_str(" - which has no source");
8791
let marked_expected = mark_missing(expected, format);
88-
format!("expected {expression} to have a source message {not}equal to \"{expected}\"\n but was: {marked_actual}\n expected: {not}{marked_expected}")
92+
format!(
93+
"expected {expression} to have a source message {not}equal to \"{expected}\"\n but was: {marked_actual}\n expected: {not}{marked_expected}"
94+
)
8995
}
9096
}
9197
}

src/expectation_combinators/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::expectations::{
2-
all, any, not, rec, IsBetween, IsEmpty, IsGreaterThan, IsLessThan, IsNegative, IsOne,
3-
IsPositive, IsZero, StringContains, StringContainsAnyOf,
2+
IsBetween, IsEmpty, IsGreaterThan, IsLessThan, IsNegative, IsOne, IsPositive, IsZero,
3+
StringContains, StringContainsAnyOf, all, any, not, rec,
44
};
55
use crate::prelude::*;
66
use crate::spec::{Expectation, Expression};

0 commit comments

Comments
 (0)