History

thanks clippy

Sebastian Thiel committed 3 years ago

Commit bac57dd1 parent e22080e100 files · +172 −230Browse files

Showing the changes to git-pathspec (1 of 100 files). Show all

Unified · Split

git-pathspec/tests/pathspec.rs+18−60
@@ -266,11 +266,7 @@ mod parse { · 265 unmodified lines
266266 fn empty_input() {
267267 let input = "";
268268
269− assert!(
270− !check_against_baseline(input),
271− "This pathspec is valid in git: {}",
272− input
273− );
269+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
274270
275271 let output = git_pathspec::parse(input.as_bytes());
276272 assert!(output.is_err());
@@ -285,11 +281,7 @@ mod parse { · 8 unmodified lines
285281 ];
286282
287283 for input in inputs.into_iter() {
288− assert!(
289− !check_against_baseline(input),
290− "This pathspec is valid in git: {}",
291− input
292− );
284+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
293285
294286 let output = git_pathspec::parse(input.as_bytes());
295287 assert!(output.is_err());
@@ -307,11 +299,7 @@ mod parse { · 11 unmodified lines
307299 ];
308300
309301 for input in inputs.into_iter() {
310− assert!(
311− !check_against_baseline(input),
312− "This pathspec is valid in git: {}",
313− input
314− );
302+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
315303
316304 let output = git_pathspec::parse(input.as_bytes());
317305 assert!(output.is_err());
@@ -329,14 +317,10 @@ mod parse { · 11 unmodified lines
329317 ];
330318
331319 for input in inputs {
332− assert!(
333− !check_against_baseline(input),
334− "This pathspec is valid in git: {}",
335− input
336− );
320+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
337321
338322 let output = git_pathspec::parse(input.as_bytes());
339− assert!(output.is_err(), "This pathspec did not produce an error {}", input);
323+ assert!(output.is_err(), "This pathspec did not produce an error {input}");
340324 assert!(matches!(output.unwrap_err(), Error::InvalidAttribute { .. }));
341325 }
342326 }
@@ -355,18 +339,13 @@ mod parse { · 12 unmodified lines
355339 ];
356340
357341 for input in inputs {
358− assert!(
359− !check_against_baseline(input),
360− "This pathspec is valid in git: {}",
361− input
362− );
342+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
363343
364344 let output = git_pathspec::parse(input.as_bytes());
365− assert!(output.is_err(), "This pathspec did not produce an error {}", input);
345+ assert!(output.is_err(), "This pathspec did not produce an error {input}");
366346 assert!(
367347 matches!(output.unwrap_err(), Error::InvalidAttributeValue { .. }),
368− "Errors did not match for pathspec: {}",
369− input
348+ "Errors did not match for pathspec: {input}"
370349 );
371350 }
372351 }
@@ -380,14 +359,10 @@ mod parse { · 7 unmodified lines
380359 ];
381360
382361 for input in inputs {
383− assert!(
384− !check_against_baseline(input),
385− "This pathspec is valid in git: {}",
386− input
387− );
362+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
388363
389364 let output = git_pathspec::parse(input.as_bytes());
390− assert!(output.is_err(), "This pathspec did not produce an error {}", input);
365+ assert!(output.is_err(), "This pathspec did not produce an error {input}");
391366 assert!(matches!(output.unwrap_err(), Error::TrailingEscapeCharacter));
392367 }
393368 }
@@ -396,11 +371,7 @@ mod parse { · 2 unmodified lines
396371 fn empty_attribute_specification() {
397372 let input = ":(attr:)";
398373
399− assert!(
400− !check_against_baseline(input),
401− "This pathspec is valid in git: {}",
402− input
403− );
374+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
404375
405376 let output = git_pathspec::parse(input.as_bytes());
406377 assert!(output.is_err());
@@ -411,11 +382,7 @@ mod parse { · 4 unmodified lines
411382 fn multiple_attribute_specifications() {
412383 let input = ":(attr:one,attr:two)some/path";
413384
414− assert!(
415− !check_against_baseline(input),
416− "This pathspec is valid in git: {}",
417− input
418− );
385+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
419386
420387 let output = git_pathspec::parse(input.as_bytes());
421388 assert!(output.is_err());
@@ -426,11 +393,7 @@ mod parse { · 4 unmodified lines
426393 fn missing_parentheses() {
427394 let input = ":(top";
428395
429− assert!(
430− !check_against_baseline(input),
431− "This pathspec is valid in git: {}",
432− input
433− );
396+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
434397
435398 let output = git_pathspec::parse(input.as_bytes());
436399 assert!(output.is_err());
@@ -441,11 +404,7 @@ mod parse { · 4 unmodified lines
441404 fn glob_and_literal_keywords_present() {
442405 let input = ":(glob,literal)some/path";
443406
444− assert!(
445− !check_against_baseline(input),
446− "This pathspec is valid in git: {}",
447− input
448− );
407+ assert!(!check_against_baseline(input), "This pathspec is valid in git: {input}");
449408
450409 let output = git_pathspec::parse(input.as_bytes());
451410 assert!(output.is_err());
@@ -457,14 +416,13 @@ mod parse { · 5 unmodified lines
457416 for (input, expected) in inputs.into_iter() {
458417 assert!(
459418 check_against_baseline(input),
460− "This pathspec is invalid in git: {}",
461− input
419+ "This pathspec is invalid in git: {input}"
462420 );
463421
464422 let pattern: PatternForTesting = git_pathspec::parse(input.as_bytes())
465− .unwrap_or_else(|_| panic!("parsing should not fail with pathspec {}", input))
423+ .unwrap_or_else(|_| panic!("parsing should not fail with pathspec {input}"))
466424 .into();
467− assert_eq!(pattern, expected, "while checking input: \"{}\"", input);
425+ assert_eq!(pattern, expected, "while checking input: \"{input}\"");
468426 }
469427 }
470428
@@ -509,7 +467,7 @@ mod parse { · 38 unmodified lines
509467 let key: &BStr = pathspec.into();
510468 let base = BASELINE
511469 .get(key)
512− .unwrap_or_else(|| panic!("missing baseline for pathspec: {:?}", pathspec));
470+ .unwrap_or_else(|| panic!("missing baseline for pathspec: {pathspec:?}"));
513471 *base == 0
514472 }
515473 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t