Repository: denoland/deno (language: rust)

Issue:
`deno //` panics
Version: Deno 2.1.10

```shell
$ deno //

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: linux x86_64
Version: 2.1.10
Args: ["deno", "//"]

thread 'main' panicked at cli/args/flags.rs:1007:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```



Discussion / hints:

Fix patch:
diff --git a/cli/args/flags.rs b/cli/args/flags.rs
index 8e06d702746ec1..02d30d055c9713 100644
--- a/cli/args/flags.rs
+++ b/cli/args/flags.rs
@@ -1006,7 +1006,7 @@ impl Flags {
             || module_specifier.scheme() == "npm"
           {
             if let Ok(p) = url_to_file_path(&module_specifier) {
-              Some(vec![p.parent().unwrap().to_path_buf()])
+              p.parent().map(|parent| vec![parent.to_path_buf()])
             } else {
               Some(vec![current_dir.to_path_buf()])
             }


Test patch:
diff --git a/tests/specs/run/with_double_slash/__test__.jsonc b/tests/specs/run/with_double_slash/__test__.jsonc
new file mode 100644
index 00000000000000..365db357cd1daa
--- /dev/null
+++ b/tests/specs/run/with_double_slash/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+  "args": "run //",
+  "exitCode": 1,
+  "output": "error: [WILDCARD]"
+}