Repository: tauri-apps/tauri
File: core/tauri/src/window.rs (Rust)

Code before:
  pub fn on_message(self, payload: InvokePayload) -> crate::Result<()> {
    let manager = self.manager.clone();

    // ensure the passed key matches what our manager should have injected
    let expected = manager.invoke_key();
    match payload.invoke_key.as_deref() {
      Some(sent) if sent == expected => { /* good */ }
      Some(sent) => {
        #[cfg(feature = "tracing")]
        tracing::error!("__TAURI_INVOKE_KEY__ expected {expected} but received {sent}");

        #[cfg(not(feature = "tracing"))]
        eprintln!("__TAURI_INVOKE_KEY__ expected {expected} but received {sent}");

        return Err(Error::InvokeKey);
      }
      None => {
        // this specific string is tested against in `core/tests/invoke-key`.
        // if this error changes then that integration test should be updated accordingly.
        let error = "received ipc message without a __TAURI_INVOKE_KEY__";

        #[cfg(feature = "tracing")]
        tracing::error!(error);

        #[cfg(not(feature = "tracing"))]
        eprintln!(error);

        return Err(Error::InvokeKey);
      }
    }

    let current_url = self.url();
    let config_url = manager.get_url();
    let is_local = config_url.make_relative(&current_url).is_some();

    let mut scope_not_found_error_message =
      ipc_scope_not_found_error_message(&self.window.label, current_url.as_str());
    let scope = if is_local {
      None
    } else {
      match self.ipc_scope().remote_access_for(&self, &current_url) {
        Ok(scope) => Some(scope),
        Err(e) => {
          if e.matches_window {
            scope_not_found_error_message = ipc_scope_domain_error_message(current_url.as_str());
          } else if e.matches_domain {
            scope_not_found_error_message = ipc_scope_window_error_message(&self.window.label);
          }
          None
        }
      }

Review comment (suggestion):
```suggestion
        eprintln!("{}", error);
```
Fixes clippy error https://github.com/tauri-apps/tauri/actions/runs/9381784496/job/25831765618?pr=9983#step:6:635


Code after:
  pub fn on_message(self, payload: InvokePayload) -> crate::Result<()> {
    let manager = self.manager.clone();

    // ensure the passed key matches what our manager should have injected
    let expected = manager.invoke_key();
    match payload.invoke_key.as_deref() {
      Some(sent) if sent == expected => { /* good */ }
      Some(sent) => {
        #[cfg(feature = "tracing")]
        tracing::error!("__TAURI_INVOKE_KEY__ expected {expected} but received {sent}");

        #[cfg(not(feature = "tracing"))]
        eprintln!("__TAURI_INVOKE_KEY__ expected {expected} but received {sent}");

        return Err(Error::InvokeKey);
      }
      None => {
        // this specific string is tested against in `core/tests/invoke-key`.
        // if this error changes then that integration test should be updated accordingly.
        let error = "received ipc message without a __TAURI_INVOKE_KEY__";

        #[cfg(feature = "tracing")]
        tracing::error!(error);

        #[cfg(not(feature = "tracing"))]
        eprintln!("{error}");

        return Err(Error::InvokeKey);
      }
    }

    let current_url = self.url();
    let config_url = manager.get_url();
    let is_local = config_url.make_relative(&current_url).is_some();

    let mut scope_not_found_error_message =
      ipc_scope_not_found_error_message(&self.window.label, current_url.as_str());
    let scope = if is_local {
      None
    } else {
      match self.ipc_scope().remote_access_for(&self, &current_url) {
        Ok(scope) => Some(scope),
        Err(e) => {
          if e.matches_window {
            scope_not_found_error_message = ipc_scope_domain_error_message(current_url.as_str());
          } else if e.matches_domain {
            scope_not_found_error_message = ipc_scope_window_error_message(&self.window.label);
          }
          None
        }
      }