Repository: tauri-apps/tauri
File: crates/tauri/src/manager/mod.rs (Rust)

Code before:
      },
      plugins: Mutex::new(plugins),
      listeners: Listeners::default(),
      state: Arc::new(state),
      config: context.config,
      #[cfg(dev)]
      config_parent: context.config_parent,
      assets: context.assets,
      app_icon: context.app_icon,
      package_info: context.package_info,
      pattern: Arc::new(context.pattern),
      plugin_global_api_scripts: Arc::new(context.plugin_global_api_scripts),
      resources_table: Arc::default(),
      invoke_key,
      channel_interceptor,
      restart_on_exit: AtomicBool::new(false),
    }
  }

  /// State managed by the application.
  pub(crate) fn state(&self) -> Arc<StateManager> {
    self.state.clone()
  }

  /// The `tauri` custom protocol URL we use to serve the embedded assets,
  /// returns `tauri://localhost` or its `wry` work around URL `http://tauri.localhost`/`https://tauri.localhost`
  pub(crate) fn tauri_protocol_url(&self, https: bool) -> Cow<'_, Url> {
    if cfg!(windows) || cfg!(target_os = "android") {
      let scheme = if https { "https" } else { "http" };
      Cow::Owned(Url::parse(&format!("{scheme}://tauri.localhost")).unwrap())
    } else {
      Cow::Owned(Url::parse("tauri://localhost").unwrap())
    }
  }

  /// Get the base app URL for [`WebviewUrl::App`](tauri_utils::config::WebviewUrl::App).
  ///
  /// * In dev mode, this is the [`devUrl`](tauri_utils::config::BuildConfig::dev_url) configuration value if it exsits.
  /// * In production mode, this is the [`frontendDist`](tauri_utils::config::BuildConfig::frontend_dist) configuration value if it's a [`FrontendDist::Url`](tauri_utils::config::FrontendDist::Url).
  /// * Returns [`Self::tauri_protocol_url`] (e.g. `tauri://localhost`) otherwise.
  pub(crate) fn get_app_url(&self, https: bool) -> Cow<'_, Url> {
    #[cfg(dev)]
    let url = self.config.build.dev_url.as_ref();
    #[cfg(not(dev))]
    let url = match self.config.build.frontend_dist.as_ref() {
      Some(crate::utils::config::FrontendDist::Url(url)) => Some(url),
      _ => None,
    };

    if let Some(url) = url {
      Cow::Borrowed(url)

Review comment (suggestion):
```suggestion
  /// The `tauri` custom protocol URL we use to serve the embedded assets.
  /// Returns `tauri://localhost` or its `wry` workaround URL `http://tauri.localhost`/`https://tauri.localhost`
```
not sure about the wry workaround part at all tbh but whatever, better than before your PR.

Code after:
      },
      plugins: Mutex::new(plugins),
      listeners: Listeners::default(),
      state: Arc::new(state),
      config: context.config,
      #[cfg(dev)]
      config_parent: context.config_parent,
      assets: context.assets,
      app_icon: context.app_icon,
      package_info: context.package_info,
      pattern: Arc::new(context.pattern),
      plugin_global_api_scripts: Arc::new(context.plugin_global_api_scripts),
      resources_table: Arc::default(),
      invoke_key,
      channel_interceptor,
      restart_on_exit: AtomicBool::new(false),
    }
  }

  /// State managed by the application.
  pub(crate) fn state(&self) -> Arc<StateManager> {
    self.state.clone()
  }

  /// The `tauri` custom protocol URL we use to serve the embedded assets.
  /// Returns `tauri://localhost` or its `wry` workaround URL `http://tauri.localhost`/`https://tauri.localhost`
  pub(crate) fn tauri_protocol_url(&self, https: bool) -> Cow<'_, Url> {
    if cfg!(windows) || cfg!(target_os = "android") {
      let scheme = if https { "https" } else { "http" };
      Cow::Owned(Url::parse(&format!("{scheme}://tauri.localhost")).unwrap())
    } else {
      Cow::Owned(Url::parse("tauri://localhost").unwrap())
    }
  }

  /// Get the base app URL for [`WebviewUrl::App`](tauri_utils::config::WebviewUrl::App).
  ///
  /// * In dev mode, this is the [`devUrl`](tauri_utils::config::BuildConfig::dev_url) configuration value if it exsits.
  /// * In production mode, this is the [`frontendDist`](tauri_utils::config::BuildConfig::frontend_dist) configuration value if it's a [`FrontendDist::Url`](tauri_utils::config::FrontendDist::Url).
  /// * Returns [`Self::tauri_protocol_url`] (e.g. `tauri://localhost`) otherwise.
  pub(crate) fn get_app_url(&self, https: bool) -> Cow<'_, Url> {
    #[cfg(dev)]
    let url = self.config.build.dev_url.as_ref();
    #[cfg(not(dev))]
    let url = match self.config.build.frontend_dist.as_ref() {
      Some(crate::utils::config::FrontendDist::Url(url)) => Some(url),
      _ => None,
    };

    if let Some(url) = url {
      Cow::Borrowed(url)