Skip to content

Commit

Permalink
chore: ignore unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kongtaoxing committed Mar 5, 2024
1 parent 89946d5 commit 27492cc
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions exercises/enums/enums3.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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, };
}

Expand All @@ -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, };
}

Expand Down
2 changes: 1 addition & 1 deletion exercises/move_semantics/move_semantics2.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion exercises/operations/operations2.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion exercises/starknet/basics/starknet1.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}

Expand Down
2 changes: 1 addition & 1 deletion exercises/starknet/basics/starknet2.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion exercises/starknet/basics/starknet4.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 27492cc

Please sign in to comment.