summaryrefslogtreecommitdiff
path: root/cli/tools/test/fmt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/test/fmt.rs')
-rw-r--r--cli/tools/test/fmt.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/tools/test/fmt.rs b/cli/tools/test/fmt.rs
index d7b357a4b..148b5845c 100644
--- a/cli/tools/test/fmt.rs
+++ b/cli/tools/test/fmt.rs
@@ -3,7 +3,9 @@
use super::*;
pub fn to_relative_path_or_remote_url(cwd: &Url, path_or_url: &str) -> String {
- let url = Url::parse(path_or_url).unwrap();
+ let Ok(url) = Url::parse(path_or_url) else {
+ return "<anonymous>".to_string();
+ };
if url.scheme() == "file" {
if let Some(mut r) = cwd.make_relative(&url) {
if !r.starts_with("../") {