tauri/examples/helloworld/main.rs
WofWca 7930dde85c
chore: examples: fix & simplify helloworld (#12995)
Remove the cookies code from it.
Firtly, they are not necessary: "Hello, world!" should be simple.
Secondly, it's broken on Windows: `.cookies()` hangs.

The cookies stuff was introduced recently,
in cedb24d494
(https://github.com/tauri-apps/tauri/pull/12665).
This commit reverts the changes to the example.

This supersedes https://github.com/tauri-apps/tauri/pull/12992.
2025-03-16 11:50:06 +02:00

20 lines
565 B
Rust

// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
#[tauri::command]
fn greet(name: &str) -> String {
format!("Hello {name}, You have been greeted from Rust!")
}
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![greet])
.run(tauri::generate_context!(
"../../examples/helloworld/tauri.conf.json"
))
.expect("error while running tauri application");
}