@@ -57,15 +57,15 @@ impl std::fmt::Display for Problem {
57
57
1 => {
58
58
id.push_str(&SPACE.repeat(2));
59
59
id.push_str(&self.fid.to_string());
60
- id.push_str(&SPACE.repeat(1 ));
60
+ id.push_str(&SPACE.to_string( ));
61
61
}
62
62
2 => {
63
- id.push_str(&SPACE.repeat(1 ));
63
+ id.push_str(&SPACE.to_string( ));
64
64
id.push_str(&self.fid.to_string());
65
- id.push_str(&SPACE.repeat(1 ));
65
+ id.push_str(&SPACE.to_string( ));
66
66
}
67
67
3 => {
68
- id.push_str(&SPACE.repeat(1 ));
68
+ id.push_str(&SPACE.to_string( ));
69
69
id.push_str(&self.fid.to_string());
70
70
}
71
71
4 => {
@@ -304,26 +304,30 @@ impl std::fmt::Display for VerifyResult {
304
304
}
305
305
write!(
306
306
f,
307
- "\n{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}.\n\n",
307
+ "\n{}{}{}\
308
+ , faster than \
309
+ {}{}\
310
+ of \
311
+ {} \
312
+ online submissions for \
313
+ {}.\n\n\
314
+ {}{}\
315
+ , less than \
316
+ {}{} \
317
+ of \
318
+ {}{}.\n\n",
308
319
"Success\n\n".green().bold(),
309
320
"Runtime: ".dimmed(),
310
321
&self.status.status_runtime.bold(),
311
- ", faster than ",
312
322
rp.to_string().bold(),
313
323
"% ".bold(),
314
- "of ",
315
324
&self.pretty_lang,
316
- " online submissions for ",
317
325
&self.name,
318
- ".\n\n",
319
326
"Memory Usage: ".dimmed(),
320
327
&self.status.status_memory.bold(),
321
- ", less than ",
322
328
mp.to_string().bold(),
323
329
"% ".bold(),
324
- "of ",
325
330
&self.pretty_lang,
326
- " online submissions for ",
327
331
&self.name,
328
332
)?
329
333
} else {
@@ -400,7 +404,7 @@ impl std::fmt::Display for VerifyResult {
400
404
401
405
match &self.result_type {
402
406
Run::Test => {
403
- if & self.code_output.len() > &0 {
407
+ if ! self.code_output.is_empty() {
404
408
write!(
405
409
f,
406
410
"{}{}",
@@ -412,7 +416,7 @@ impl std::fmt::Display for VerifyResult {
412
416
}
413
417
}
414
418
_ => {
415
- if & self.std_output.len() > &0 {
419
+ if ! self.std_output.is_empty() {
416
420
write!(
417
421
f,
418
422
"{}{}",
@@ -510,19 +514,19 @@ mod verify {
510
514
511
515
/// Formatter for str
512
516
trait Formatter {
513
- fn after_spaces<'f> (&self, spaces: usize) -> String;
514
- fn before_spaces<'f> (&self, spaces: usize) -> String;
517
+ fn after_spaces(&self, spaces: usize) -> String;
518
+ fn before_spaces(&self, spaces: usize) -> String;
515
519
}
516
520
517
521
impl Formatter for str {
518
- fn after_spaces<'f> (&self, spaces: usize) -> String {
522
+ fn after_spaces(&self, spaces: usize) -> String {
519
523
let mut r = String::new();
520
524
r.push_str(self);
521
525
r.push_str(&" ".repeat(spaces));
522
526
r
523
527
}
524
528
525
- fn before_spaces<'f> (&self, spaces: usize) -> String {
529
+ fn before_spaces(&self, spaces: usize) -> String {
526
530
let mut r = String::new();
527
531
r.push_str(&" ".repeat(spaces));
528
532
r.push_str(self);
0 commit comments