Skip to content

Commit

Permalink
docs: clean up meaning of field
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed Aug 8, 2024
1 parent 72a7f86 commit 85d378a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/serve/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ const INDEX_HTML: &str = "index.html";
pub struct ServeSystem {
cfg: Arc<RtcServe>,
watch: WatchSystem,
http_addr: String,
/// The URL to open when starting
open_http_addr: String,
shutdown_tx: broadcast::Sender<()>,
// N.B. we use a broadcast channel here because a watch channel triggers a
// false positive on the first read of channel
Expand All @@ -60,11 +61,11 @@ impl ServeSystem {
None => IpAddr::V4(Ipv4Addr::LOCALHOST),
};
let base = cfg.serve_base()?;
let http_addr = format!("{prefix}://{address}:{port}{base}", port = cfg.port);
let open_http_addr = format!("{prefix}://{address}:{port}{base}", port = cfg.port);
Ok(Self {
cfg,
watch,
http_addr,
open_http_addr,
shutdown_tx: shutdown,
ws_state,
})
Expand All @@ -84,7 +85,7 @@ impl ServeSystem {

// Open the browser.
if self.cfg.open {
if let Err(err) = open::that(self.http_addr) {
if let Err(err) = open::that(self.open_http_addr) {
tracing::error!(error = ?err, "error opening browser");
}
}
Expand Down

0 comments on commit 85d378a

Please sign in to comment.