Skip to content

Commit 7728aae

Browse files
committed
chore: clippy
1 parent cbc75ab commit 7728aae

File tree

13 files changed

+28
-31
lines changed

13 files changed

+28
-31
lines changed

fvm/src/executor/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ impl ApplyRet {
126126
/// The kind of message being applied:
127127
///
128128
/// 1. Explicit messages may only come from account actors and charge the sending account for gas
129-
/// consumed.
129+
/// consumed.
130130
/// 2. Implicit messages may come from any actor, ignore the nonce, and charge no gas (but still
131-
/// account for it).
131+
/// account for it).
132132
#[derive(Eq, PartialEq, Copy, Clone, Debug)]
133133
pub enum ApplyKind {
134134
Explicit,

fvm/src/kernel/filecoin.rs

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ pub trait FilecoinKernel: Kernel {
5252
/// - first header is of the same or lower epoch as the second
5353
/// - at least one of the headers appears in the current chain at or after epoch `earliest`
5454
/// - the headers provide evidence of a fault (see the spec for the different fault types).
55+
///
5556
/// The parameters are all serialized block headers. The third "extra" parameter is consulted only for
5657
/// the "parent grinding fault", in which case it must be the sibling of h1 (same parent tipset) and one of the
5758
/// blocks in the parent of h2 (i.e. h2's grandparent).
@@ -81,13 +82,15 @@ pub trait FilecoinKernel: Kernel {
8182
/// The circulating supply is the sum of:
8283
/// - rewards emitted by the reward actor,
8384
/// - funds vested from lock-ups in the genesis state,
85+
///
8486
/// less the sum of:
8587
/// - funds burnt,
8688
/// - pledge collateral locked in storage miner actors (recorded in the storage power actor)
8789
/// - deal collateral locked by the storage market actor
8890
fn total_fil_circ_supply(&self) -> Result<TokenAmount>;
8991
}
9092

93+
#[allow(clippy::duplicated_attributes)]
9194
#[derive(Delegate)]
9295
#[delegate(IpldBlockOps, where = "C: CallManager")]
9396
#[delegate(ActorOps, where = "C: CallManager")]

fvm/src/syscalls/filecoin.rs

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ pub fn verify_post(
100100
/// - first header is of the same or lower epoch as the second
101101
/// - at least one of the headers appears in the current chain at or after epoch `earliest`
102102
/// - the headers provide evidence of a fault (see the spec for the different fault types).
103+
///
103104
/// The parameters are all serialized block headers. The third "extra" parameter is consulted only for
104105
/// the "parent grinding fault", in which case it must be the sibling of h1 (same parent tipset) and one of the
105106
/// blocks in the parent of h2 (i.e. h2's grandparent).

fvm/tests/dummy.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ pub struct DummyCallManager {
189189
pub gas_tracker: GasTracker,
190190
pub gas_premium: TokenAmount,
191191
pub origin: ActorID,
192-
pub origin_address: Address,
193192
pub nonce: u64,
194193
pub test_data: Rc<RefCell<TestData>>,
195194
limits: DummyLimiter,
@@ -216,7 +215,6 @@ impl DummyCallManager {
216215
nonce: 0,
217216
test_data: rc,
218217
limits: DummyLimiter::default(),
219-
origin_address: Address::new_id(0),
220218
gas_premium: TokenAmount::zero(),
221219
},
222220
cell_ref,
@@ -236,7 +234,6 @@ impl DummyCallManager {
236234
nonce: 0,
237235
test_data: rc,
238236
limits: DummyLimiter::default(),
239-
origin_address: Address::new_id(0),
240237
gas_premium: TokenAmount::zero(),
241238
},
242239
cell_ref,
@@ -252,7 +249,7 @@ impl CallManager for DummyCallManager {
252249
_engine: Engine,
253250
_gas_limit: u64,
254251
origin: ActorID,
255-
origin_address: Address,
252+
_origin_address: Address,
256253
_receiver: Option<ActorID>,
257254
_receiver_address: Address,
258255
nonce: u64,
@@ -267,7 +264,6 @@ impl CallManager for DummyCallManager {
267264
gas_tracker: GasTracker::new(BLOCK_GAS_LIMIT, Gas::new(0), false),
268265
gas_premium,
269266
origin,
270-
origin_address,
271267
nonce,
272268
test_data: rc,
273269
limits,

ipld/amt/benches/amt_benchmark.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl<'de> Deserialize<'de> for BenchData {
4040
where
4141
D: Deserializer<'de>,
4242
{
43-
Deserialize::deserialize(deserializer)?;
43+
let _: () = Deserialize::deserialize(deserializer)?;
4444
Ok(Self::default())
4545
}
4646
}

ipld/amt/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ const MAX_HEIGHT: u32 = 64;
2727

2828
/// MaxIndex is the maximum index for elements in the AMT. This u64::MAX-1 so we
2929
/// don't overflow u64::MAX when computing the length.
30-
pub const MAX_INDEX: u64 = std::u64::MAX - 1;
30+
pub const MAX_INDEX: u64 = u64::MAX - 1;
3131

3232
fn nodes_for_height(bit_width: u32, height: u32) -> u64 {
3333
let height_log_two = bit_width as u64 * height as u64;
3434
if height_log_two >= 64 {
35-
return std::u64::MAX;
35+
return u64::MAX;
3636
}
3737
1 << height_log_two
3838
}

ipld/hamt/src/bitfield.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Copyright 2019-2022 ChainSafe Systems
33
// SPDX-License-Identifier: Apache-2.0, MIT
44

5-
use std::u64;
6-
75
use byteorder::{BigEndian, ByteOrder};
86
use fvm_ipld_encoding::de::{Deserialize, Deserializer};
97
use fvm_ipld_encoding::ser::{Serialize, Serializer};
@@ -117,16 +115,16 @@ impl Bitfield {
117115
if bit < 64 {
118116
self.0[0] = set_bits_leq(self.0[0], bit);
119117
} else if bit < 128 {
120-
self.0[0] = std::u64::MAX;
118+
self.0[0] = u64::MAX;
121119
self.0[1] = set_bits_leq(self.0[1], bit - 64);
122120
} else if bit < 192 {
123-
self.0[0] = std::u64::MAX;
124-
self.0[1] = std::u64::MAX;
121+
self.0[0] = u64::MAX;
122+
self.0[1] = u64::MAX;
125123
self.0[2] = set_bits_leq(self.0[2], bit - 128);
126124
} else {
127-
self.0[0] = std::u64::MAX;
128-
self.0[1] = std::u64::MAX;
129-
self.0[2] = std::u64::MAX;
125+
self.0[0] = u64::MAX;
126+
self.0[1] = u64::MAX;
127+
self.0[2] = u64::MAX;
130128
self.0[3] = set_bits_leq(self.0[3], bit - 192);
131129
}
132130

ipld/kamt/src/bitfield.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Copyright 2019-2022 ChainSafe Systems
33
// SPDX-License-Identifier: Apache-2.0, MIT
44

5-
use std::u64;
6-
75
use byteorder::{BigEndian, ByteOrder};
86
use fvm_ipld_encoding::de::{Deserialize, Deserializer};
97
use fvm_ipld_encoding::ser::{Serialize, Serializer};
@@ -128,16 +126,16 @@ impl Bitfield {
128126
if bit < 64 {
129127
self.0[0] = set_bits_leq(self.0[0], bit);
130128
} else if bit < 128 {
131-
self.0[0] = std::u64::MAX;
129+
self.0[0] = u64::MAX;
132130
self.0[1] = set_bits_leq(self.0[1], bit - 64);
133131
} else if bit < 192 {
134-
self.0[0] = std::u64::MAX;
135-
self.0[1] = std::u64::MAX;
132+
self.0[0] = u64::MAX;
133+
self.0[1] = u64::MAX;
136134
self.0[2] = set_bits_leq(self.0[2], bit - 128);
137135
} else {
138-
self.0[0] = std::u64::MAX;
139-
self.0[1] = std::u64::MAX;
140-
self.0[2] = std::u64::MAX;
136+
self.0[0] = u64::MAX;
137+
self.0[1] = u64::MAX;
138+
self.0[2] = u64::MAX;
141139
self.0[3] = set_bits_leq(self.0[3], bit - 192);
142140
}
143141

sdk/src/crypto.rs

+1
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ pub fn verify_post(info: &WindowPoStVerifyInfo) -> SyscallResult<bool> {
238238
/// - first header is of the same or lower epoch as the second
239239
/// - at least one of the headers appears in the current chain at or after epoch `earliest`
240240
/// - the headers provide evidence of a fault (see the spec for the different fault types).
241+
///
241242
/// The parameters are all serialized block headers. The third "extra" parameter is consulted only for
242243
/// the "parent grinding fault", in which case it must be the sibling of h1 (same parent tipset) and one of the
243244
/// blocks in the parent of h2 (i.e. h2's grandparent).

shared/src/address/payload.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use std::array::from_fn;
77
use std::convert::TryInto;
88
use std::hash::Hash;
9-
use std::u64;
109

1110
use super::{
1211
from_leb_bytes, to_leb_bytes, Error, Protocol, BLS_PUB_LEN, MAX_SUBADDRESS_LEN,

shared/src/address/protocol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Copyright 2019-2022 ChainSafe Systems
33
// SPDX-License-Identifier: Apache-2.0, MIT
44

5+
use std::fmt;
56
use std::hash::Hash;
6-
use std::{fmt, u64};
77

88
use num_derive::FromPrimitive;
99
use num_traits::FromPrimitive;

shared/tests/address_test.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,12 @@ fn delegated_address() {
234234
expected: "f432f77777777x32lpna",
235235
},
236236
F4TestVec {
237-
namespace: std::u64::MAX,
237+
namespace: u64::MAX,
238238
subaddr: &[],
239239
expected: "f418446744073709551615ftnkyfaq",
240240
},
241241
F4TestVec {
242-
namespace: std::u64::MAX,
242+
namespace: u64::MAX,
243243
subaddr: &[0; MAX_SUBADDRESS_LEN],
244244
expected: "f418446744073709551615faaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafbbuagu",
245245
},
@@ -291,7 +291,7 @@ fn id_address() {
291291
expected: "f0999999",
292292
},
293293
IDTestVec {
294-
input: std::u64::MAX,
294+
input: u64::MAX,
295295
expected: "f018446744073709551615",
296296
},
297297
];

testing/integration/src/custom_kernel/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pub trait CustomKernel: Kernel {
3030
}
3131

3232
// our custom kernel extends the filecoin kernel
33+
#[allow(clippy::duplicated_attributes)]
3334
#[derive(Delegate)]
3435
#[delegate(IpldBlockOps, where = "C: CallManager")]
3536
#[delegate(ActorOps, where = "C: CallManager")]

0 commit comments

Comments
 (0)