File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -8,31 +8,31 @@ use std::sync::Mutex;
8
8
9
9
use tauri:: State ;
10
10
11
- struct Counter ( Mutex < usize > ) ;
11
+ struct Counter ( Mutex < isize > ) ;
12
12
13
13
#[ tauri:: command]
14
- fn increment ( counter : State < ' _ , Counter > ) -> usize {
14
+ fn increment ( counter : State < ' _ , Counter > ) -> isize {
15
15
let mut c = counter. 0 . lock ( ) . unwrap ( ) ;
16
16
* c += 1 ;
17
17
* c
18
18
}
19
19
20
20
#[ tauri:: command]
21
- fn decrement ( counter : State < ' _ , Counter > ) -> usize {
21
+ fn decrement ( counter : State < ' _ , Counter > ) -> isize {
22
22
let mut c = counter. 0 . lock ( ) . unwrap ( ) ;
23
23
* c -= 1 ;
24
24
* c
25
25
}
26
26
27
27
#[ tauri:: command]
28
- fn reset ( counter : State < ' _ , Counter > ) -> usize {
28
+ fn reset ( counter : State < ' _ , Counter > ) -> isize {
29
29
let mut c = counter. 0 . lock ( ) . unwrap ( ) ;
30
30
* c = 0 ;
31
31
* c
32
32
}
33
33
34
34
#[ tauri:: command]
35
- fn get ( counter : State < ' _ , Counter > ) -> usize {
35
+ fn get ( counter : State < ' _ , Counter > ) -> isize {
36
36
* counter. 0 . lock ( ) . unwrap ( )
37
37
}
38
38
You can’t perform that action at this time.
0 commit comments