Skip to content

Commit

Permalink
fix: clippy linting
Browse files Browse the repository at this point in the history
  • Loading branch information
bidzyyys committed Apr 30, 2024
1 parent 7f8459b commit c99e569
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
7 changes: 1 addition & 6 deletions contracts/src/erc20/extensions/burnable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ mod tests {
impl IERC20Burnable for ERC20 {}

sol_storage! {
#[derive(Default)]
pub struct TestERC20Burnable {
ERC20 erc20;
}
Expand All @@ -153,12 +154,6 @@ mod tests {
erc20_burnable_impl!();
}

impl Default for TestERC20Burnable {
fn default() -> Self {
Self { erc20: ERC20::default() }
}
}

#[grip::test]
fn burns(contract: TestERC20Burnable) {
let zero = U256::ZERO;
Expand Down
1 change: 1 addition & 0 deletions contracts/src/erc20/extensions/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub const DEFAULT_DECIMALS: u8 = 18;

sol_storage! {
/// Optional metadata of the ERC-20 standard.
#[allow(clippy::pub_underscore_fields)]
pub struct Metadata {
/// Token name.
string _name;
Expand Down
1 change: 1 addition & 0 deletions contracts/src/erc20/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ macro_rules! erc20_impl {

sol_storage! {
/// State of an ERC20 token.
#[allow(clippy::pub_underscore_fields)]
pub struct ERC20 {
/// Maps users to balances.
mapping(address => uint256) _balances;
Expand Down
1 change: 1 addition & 0 deletions contracts/src/utils/capped.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use stylus_sdk::{evm, msg};

sol_storage! {
/// State of a Capped Contract.
#[allow(clippy::pub_underscore_fields)]
pub struct Capped {
/// A cap to the supply of tokens.
uint256 _cap;
Expand Down
9 changes: 2 additions & 7 deletions contracts/src/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
//! TODO docs
// cfg_if::cfg_if! {
// if #[cfg(any(test, feature = "erc20_pausable"))] {
pub mod pausable;
// }
// }
//! Smart Contracts for building tokens' extensions.
pub mod capped;
pub mod pausable;
1 change: 1 addition & 0 deletions contracts/src/utils/pausable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use stylus_sdk::{evm, msg};

sol_storage! {
/// State of a Pausable Contract.
#[allow(clippy::pub_underscore_fields)]
pub struct Pausable {
/// Indicates whether the contract is `Paused`.
bool _paused;
Expand Down

0 comments on commit c99e569

Please sign in to comment.