File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -11,5 +11,5 @@ path = "lib.rs"
11
11
12
12
[dependencies ]
13
13
candid = " 0.10.10"
14
- ic-cdk = " 0.16.0 "
14
+ ic-cdk = " 0.18.3 "
15
15
ic-stable-structures = " 0.6.7"
Original file line number Diff line number Diff line change @@ -24,16 +24,13 @@ thread_local! {
24
24
// This update method stores the greeting prefix in stable memory.
25
25
#[ ic_cdk:: update]
26
26
fn set_greeting ( prefix : String ) {
27
- GREETING . with_borrow_mut ( |greeting| {
28
- greeting. set ( prefix) . unwrap ( ) ;
29
- } ) ;
27
+ GREETING . with_borrow_mut ( |greeting| greeting. set ( prefix) . unwrap ( ) ) ;
30
28
}
31
29
32
30
// This query method returns the currently persisted greeting with the given name.
33
31
#[ ic_cdk:: query]
34
32
fn greet ( name : String ) -> String {
35
- let greeting = GREETING . with_borrow ( |greeting| greeting. get ( ) . clone ( ) ) ;
36
- format ! ( "{greeting}{name}!" )
33
+ GREETING . with_borrow ( |greeting| format ! ( "{}{name}!" , greeting. get( ) ) )
37
34
}
38
35
39
36
// Export the interface for the smart contract.
You can’t perform that action at this time.
0 commit comments