diff options
author | Satya Rohith <me@satyarohith.com> | 2024-05-17 11:08:50 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-17 05:38:50 +0000 |
commit | 20cb0e8863beb0d709adc2f41905ce3f1f465447 (patch) | |
tree | 4a07e3bf67905e14513d8372db84169d493dfc8f /runtime/worker_bootstrap.rs | |
parent | 2b560be83f621af5cab1ff09fa0e76c826e6870a (diff) |
feat(serve): support `--port 0` to use an open port (#23846)
Closes https://github.com/denoland/deno/issues/23845
Diffstat (limited to 'runtime/worker_bootstrap.rs')
-rw-r--r-- | runtime/worker_bootstrap.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/runtime/worker_bootstrap.rs b/runtime/worker_bootstrap.rs index e1abf87fc..0838da2d1 100644 --- a/runtime/worker_bootstrap.rs +++ b/runtime/worker_bootstrap.rs @@ -4,7 +4,6 @@ use deno_core::v8; use deno_core::ModuleSpecifier; use serde::Serialize; use std::cell::RefCell; -use std::num::NonZeroU16; use std::thread; use deno_terminal::colors; @@ -93,7 +92,7 @@ pub struct BootstrapOptions { pub future: bool, pub mode: WorkerExecutionMode, // Used by `deno serve` - pub serve_port: Option<NonZeroU16>, + pub serve_port: Option<u16>, pub serve_host: Option<String>, } @@ -198,7 +197,7 @@ impl BootstrapOptions { self.verbose_deprecated_api_warning, self.future, self.mode as u8 as _, - self.serve_port.map(|x| x.into()).unwrap_or_default(), + self.serve_port.unwrap_or_default(), self.serve_host.as_deref(), ); |