summaryrefslogtreecommitdiff
path: root/cli/diagnostics.rs
diff options
context:
space:
mode:
authorKNnut <9387720+KNnut@users.noreply.github.com>2020-11-09 22:38:29 +0800
committerGitHub <noreply@github.com>2020-11-09 15:38:29 +0100
commitaaf7166a9d528636b11a2ad835238589bf650b6e (patch)
treead209b2e48d0475a5ff65427ee3ca9a49c1c9851 /cli/diagnostics.rs
parent8b7f5531ee1ccde897e87890e9aabc554fedb9dd (diff)
refactor(cli): remove unnecessary format! calls (#8315)
Diffstat (limited to 'cli/diagnostics.rs')
-rw-r--r--cli/diagnostics.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs
index ba21e5aa9..af2a63ad9 100644
--- a/cli/diagnostics.rs
+++ b/cli/diagnostics.rs
@@ -546,7 +546,7 @@ mod tests {
}
]);
let diagnostics: Diagnostics = serde_json::from_value(value).unwrap();
- let actual = format!("{}", diagnostics);
+ let actual = diagnostics.to_string();
assert_eq!(
strip_ansi_codes(&actual),
"TS5023 [ERROR]: Unknown compiler option \'invalid\'."
@@ -573,7 +573,7 @@ mod tests {
}
]);
let diagnostics: Diagnostics = serde_json::from_value(value).unwrap();
- let actual = format!("{}", diagnostics);
+ let actual = diagnostics.to_string();
assert_eq!(strip_ansi_codes(&actual), "TS2584 [ERROR]: Cannot find name \'console\'. Do you need to change your target library? Try changing the `lib` compiler option to include \'dom\'.\nconsole.log(\"a\");\n~~~~~~~\n at test.ts:1:1");
}
@@ -614,7 +614,7 @@ mod tests {
}
]);
let diagnostics: Diagnostics = serde_json::from_value(value).unwrap();
- let actual = format!("{}", diagnostics);
+ let actual = diagnostics.to_string();
assert_eq!(strip_ansi_codes(&actual), "TS2552 [ERROR]: Cannot find name \'foo_Bar\'. Did you mean \'foo_bar\'?\nfoo_Bar();\n~~~~~~~\n at test.ts:8:1\n\n \'foo_bar\' is declared here.\n function foo_bar() {\n ~~~~~~~\n at test.ts:4:10");
}
@@ -655,7 +655,7 @@ mod tests {
}
];
let diagnostics: Diagnostic = serde_json::from_value(value).unwrap();
- let actual = format!("{}", diagnostics);
+ let actual = diagnostics.to_string();
assert_eq!(strip_ansi_codes(&actual), "TS2551 [ERROR]: Property \'ppid\' does not exist on type \'typeof Deno\'. \'Deno.ppid\' is an unstable API. Did you forget to run with the \'--unstable\' flag, or did you mean \'pid\'?\nconsole.log(Deno.ppid);\n ~~~~\n at file:///cli/tests/unstable_ts2551.ts:1:18\n\n \'pid\' is declared here.\n export const pid: number;\n ~~~\n at asset:///lib.deno.ns.d.ts:90:16");
}
}