diff --git a/.github/workflows/rust-checks.yml b/.github/workflows/rust-checks.yml new file mode 100644 index 0000000..1b5fb2d --- /dev/null +++ b/.github/workflows/rust-checks.yml @@ -0,0 +1,39 @@ +name: Rust-Checks + +on: + pull_request: + push: + branches: main + +jobs: + fmt: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Rust toolchain + uses: ./.github/actions/install-rust-toolchain + with: + components: rustfmt + + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + clippy: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Rust toolchain + uses: ./.github/actions/install-rust-toolchain + with: + components: clippy + + - uses: actions-rs/cargo@v1 + with: + command: clippy + args: --all --all-targets -- -D warnings diff --git a/src/lib.rs b/src/lib.rs index 70b4139..76ea0d3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0, MIT //! This is the top level documentation! +#![allow(async_fn_in_trait)] pub mod account; pub mod error; diff --git a/src/store/injected_store.rs b/src/store/injected_store.rs index fdfb642..3e0d469 100644 --- a/src/store/injected_store.rs +++ b/src/store/injected_store.rs @@ -1,8 +1,8 @@ // Copyright 2024 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT -use crate::store::WalletStore; use crate::error::Error; +use crate::store::WalletStore; use wasm_bindgen::prelude::*; #[wasm_bindgen(typescript_custom_section)] diff --git a/src/store/memory_store.rs b/src/store/memory_store.rs index 42ce153..89c87b5 100644 --- a/src/store/memory_store.rs +++ b/src/store/memory_store.rs @@ -1,8 +1,8 @@ // Copyright 2024 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT -use crate::store::WalletStore; use crate::error::Error; +use crate::store::WalletStore; /// A simple in-memory store for wallet data. Useful for testing pub struct MemoryStore { diff --git a/tests/web_accounts.rs b/tests/web_accounts.rs index 5f21e54..ef854ea 100644 --- a/tests/web_accounts.rs +++ b/tests/web_accounts.rs @@ -6,5 +6,5 @@ use webz_core::account::Account; #[wasm_bindgen_test] fn test_account_from_seed() { let seed = [0; 32]; - let a = Account::from_seed(&seed, 0).unwrap(); + let _a = Account::from_seed(&seed, 0).unwrap(); }