Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Nov 12, 2023
1 parent 46090ee commit 2a0a251
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/dilazionato/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ mod test {
fn test_should_get_tx() {
assert!(Dilazionato::transaction(Nat::from(1)).is_err());
let id = TxHistory::register_token_mint(&mock_token(1, 1));
assert!(Dilazionato::transaction(Nat::from(id)).is_ok());
assert!(Dilazionato::transaction(id).is_ok());
}

#[test]
Expand Down
10 changes: 3 additions & 7 deletions src/dilazionato/src/app/roles.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Roles
use std::borrow::BorrowMut;

use std::cell::RefCell;

use candid::Principal;
Expand Down Expand Up @@ -36,7 +36,7 @@ impl RolesManager {
roles_map
.iter()
.filter(|(_, roles)| roles.0.contains(&Role::Custodian))
.map(|(principal, _)| principal.clone().0)
.map(|(principal, _)| principal.0)
.collect()
})
}
Expand Down Expand Up @@ -95,11 +95,7 @@ impl RolesManager {
F: FnOnce(&Roles) -> T,
{
CANISTER_ROLES.with_borrow(|roles_map| {
if let Some(roles) = roles_map.get(&principal.into()) {
Some(f(&roles))
} else {
None
}
roles_map.get(&principal.into()).map(|roles| f(&roles))
})
}

Expand Down
2 changes: 1 addition & 1 deletion src/dilazionato/src/app/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn mock_contract(id: u64, token_ids: &[u64]) -> Contract {
}

pub fn store_mock_contract(token_ids: &[u64], contract_id: u64) {
store_mock_contract_with(token_ids, contract_id, |_| {}.into(), |_| {})
store_mock_contract_with(token_ids, contract_id, |_| {}, |_| {})
}

pub fn store_mock_contract_with<F, F2>(
Expand Down
2 changes: 1 addition & 1 deletion src/dilazionato/src/client/fly_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub fn fly_client(principal: Principal) -> IcFlyClient {

#[cfg(test)]
pub fn fly_client(_principal: Principal) -> IcFlyClient {
IcFlyClient::default()
IcFlyClient
}

#[async_trait]
Expand Down
6 changes: 3 additions & 3 deletions src/fly/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use candid::{candid_method, Nat, Principal};
use did::ID;
use ic_cdk_macros::{init, post_upgrade, query, update};




#[allow(dead_code)]
fn main() {
Expand Down

0 comments on commit 2a0a251

Please sign in to comment.