From 20cb0e8863beb0d709adc2f41905ce3f1f465447 Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Fri, 17 May 2024 11:08:50 +0530 Subject: feat(serve): support `--port 0` to use an open port (#23846) Closes https://github.com/denoland/deno/issues/23845 --- runtime/worker_bootstrap.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'runtime') 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, + pub serve_port: Option, pub serve_host: Option, } @@ -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(), ); -- cgit v1.2.3