Skip to content

Commit c1f8e11

Browse files
author
Ngo Iok Ui (Wu Yu Wei)
authored
chore: remove unnecessary anonymous lifetimes (#1829)
1 parent 9a60c10 commit c1f8e11

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

File renamed without changes.

core/tauri/src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ where
341341
/// struct MyString(String);
342342
///
343343
/// #[tauri::command]
344-
/// fn int_command(state: State<'_, MyInt>) -> String {
344+
/// fn int_command(state: State<MyInt>) -> String {
345345
/// format!("The stateful int is: {}", state.0)
346346
/// }
347347
///

examples/commands/src-tauri/src/commands.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ pub fn simple_command(argument: String) {
2222
}
2323

2424
#[command]
25-
pub fn stateful_command(argument: Option<String>, state: State<'_, super::MyState>) {
25+
pub fn stateful_command(argument: Option<String>, state: State<super::MyState>) {
2626
println!("{:?} {:?}", argument, state.inner());
2727
}

examples/splashscreen/src-tauri/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ mod ui {
5454
#[tauri::command]
5555
fn close_splashscreen<P: Params>(
5656
_: Window<P>, // force inference of P
57-
splashscreen: State<'_, SplashscreenWindow<P>>,
58-
main: State<'_, MainWindow<P>>,
57+
splashscreen: State<SplashscreenWindow<P>>,
58+
main: State<MainWindow<P>>,
5959
) {
6060
// Close splashscreen
6161
splashscreen.0.lock().unwrap().close().unwrap();

examples/state/src-tauri/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ struct Counter(AtomicUsize);
2323
struct Database(Arc<Mutex<HashMap<String, String>>>);
2424

2525
#[tauri::command]
26-
fn increment_counter(counter: State<'_, Counter>) -> usize {
26+
fn increment_counter(counter: State<Counter>) -> usize {
2727
counter.0.fetch_add(1, Ordering::Relaxed) + 1
2828
}
2929

3030
#[tauri::command]
31-
fn db_insert(key: String, value: String, db: State<'_, Database>) {
31+
fn db_insert(key: String, value: String, db: State<Database>) {
3232
db.0.lock().unwrap().insert(key, value);
3333
}
3434

3535
#[tauri::command]
36-
fn db_read(key: String, db: State<'_, Database>) -> Option<String> {
36+
fn db_read(key: String, db: State<Database>) -> Option<String> {
3737
db.0.lock().unwrap().get(&key).cloned()
3838
}
3939

0 commit comments

Comments
 (0)