From 27492ccce2029a96eff5d0ef9e3c01da50c0c19e Mon Sep 17 00:00:00 2001 From: kongtaoxing Date: Tue, 5 Mar 2024 16:41:02 +0800 Subject: [PATCH] chore: ignore unused variables --- exercises/enums/enums3.cairo | 6 +++--- exercises/move_semantics/move_semantics2.cairo | 2 +- exercises/operations/operations2.cairo | 2 +- exercises/starknet/basics/starknet1.cairo | 2 +- exercises/starknet/basics/starknet2.cairo | 2 +- exercises/starknet/basics/starknet4.cairo | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/exercises/enums/enums3.cairo b/exercises/enums/enums3.cairo index 0b7c9b632..d2e534777 100644 --- a/exercises/enums/enums3.cairo +++ b/exercises/enums/enums3.cairo @@ -32,11 +32,11 @@ trait StateTrait { } impl StateImpl of StateTrait { fn change_color(ref self: State, new_color: (u8, u8, u8)) { - let State{color, position, quit, } = self; + let State{color: _color, position, quit, } = self; self = State { color: new_color, position: position, quit: quit, }; } fn quit(ref self: State) { - let State{color, position, quit, } = self; + let State{color, position, quit: _quit, } = self; self = State { color: color, position: position, quit: true, }; } @@ -45,7 +45,7 @@ impl StateImpl of StateTrait { } fn move_position(ref self: State, p: Point) { - let State{color, position, quit, } = self; + let State{color, position: _posiotion, quit, } = self; self = State { color: color, position: p, quit: quit, }; } diff --git a/exercises/move_semantics/move_semantics2.cairo b/exercises/move_semantics/move_semantics2.cairo index 729af3b19..c56e6f5be 100644 --- a/exercises/move_semantics/move_semantics2.cairo +++ b/exercises/move_semantics/move_semantics2.cairo @@ -10,7 +10,7 @@ use debug::PrintTrait; fn main() { let arr0 = ArrayTrait::new(); - let mut arr1 = fill_arr(arr0); + let mut _arr1 = fill_arr(arr0); // Do not change the following line! arr0.print(); diff --git a/exercises/operations/operations2.cairo b/exercises/operations/operations2.cairo index db2d65ea1..475b8f5f0 100644 --- a/exercises/operations/operations2.cairo +++ b/exercises/operations/operations2.cairo @@ -55,5 +55,5 @@ fn test_mul() { #[test] #[should_panic] fn test_u64_mul_overflow_1() { - let res = multiplication(0x100000000, 0x100000000); + let _res = multiplication(0x100000000, 0x100000000); } diff --git a/exercises/starknet/basics/starknet1.cairo b/exercises/starknet/basics/starknet1.cairo index 26c4dab69..539bf3258 100644 --- a/exercises/starknet/basics/starknet1.cairo +++ b/exercises/starknet/basics/starknet1.cairo @@ -41,7 +41,7 @@ mod test { #[available_gas(2000000000)] fn test_contract_view() { let dispatcher = deploy_contract(); - let owner = dispatcher.get_owner(); + let _owner = dispatcher.get_owner(); assert('Joe' == dispatcher.get_owner(), 'Joe should be the owner.'); } diff --git a/exercises/starknet/basics/starknet2.cairo b/exercises/starknet/basics/starknet2.cairo index a0dc59d5e..1c5b6e3cf 100644 --- a/exercises/starknet/basics/starknet2.cairo +++ b/exercises/starknet/basics/starknet2.cairo @@ -55,7 +55,7 @@ mod test { #[test] #[available_gas(2000000000)] fn test_owner_setting() { - let owner: felt252 = 'Jill'; + let _owner: felt252 = 'Jill'; let mut calldata = ArrayTrait::new(); calldata.append('Jill'); let (address0, _) = deploy_syscall( diff --git a/exercises/starknet/basics/starknet4.cairo b/exercises/starknet/basics/starknet4.cairo index 098a9bdb8..581d9fcf5 100644 --- a/exercises/starknet/basics/starknet4.cairo +++ b/exercises/starknet/basics/starknet4.cairo @@ -112,7 +112,7 @@ mod test { fn test_stock_purchase() { let owner = util_felt_addr('Elizabeth'); let dispatcher = deploy_contract(); - let result = dispatcher.get_owner(); + let _result = dispatcher.get_owner(); // Call contract as owner starknet::testing::set_contract_address(owner);