Skip to content

Commit 2f56133

Browse files
authored
feat: bump MSRV to 1.83 (#9473)
1 parent 8ef1302 commit 2f56133

File tree

11 files changed

+15
-16
lines changed

11 files changed

+15
-16
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ resolver = "2"
3030
version = "0.2.0"
3131
edition = "2021"
3232
# Remember to update clippy.toml as well
33-
rust-version = "1.80"
33+
rust-version = "1.83"
3434
authors = ["Foundry Contributors"]
3535
license = "MIT OR Apache-2.0"
3636
homepage = "https://github.com/foundry-rs/foundry"

clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
msrv = "1.80"
1+
msrv = "1.83"
22
# bytes::Bytes is included by default and alloy_primitives::Bytes is a wrapper around it,
33
# so it is safe to ignore it as well
44
ignore-interior-mutability = ["bytes::Bytes", "alloy_primitives::Bytes"]

crates/cheatcodes/src/evm/mock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ fn mock_calls(
213213
fn make_acc_non_empty(callee: &Address, ecx: InnerEcx) -> Result {
214214
let acc = ecx.load_account(*callee)?;
215215

216-
let empty_bytecode = acc.info.code.as_ref().map_or(true, Bytecode::is_empty);
216+
let empty_bytecode = acc.info.code.as_ref().is_none_or(Bytecode::is_empty);
217217
if empty_bytecode {
218218
let code = Bytecode::new_raw(Bytes::from_static(&[0u8]));
219219
ecx.journaled_state.set_code(*callee, code);

crates/cheatcodes/src/inspector.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -902,12 +902,11 @@ where {
902902
*calldata == call.input[..calldata.len()] &&
903903
// The value matches, if provided
904904
expected
905-
.value
906-
.map_or(true, |value| Some(value) == call.transfer_value()) &&
905+
.value.is_none_or(|value| Some(value) == call.transfer_value()) &&
907906
// The gas matches, if provided
908-
expected.gas.map_or(true, |gas| gas == call.gas_limit) &&
907+
expected.gas.is_none_or(|gas| gas == call.gas_limit) &&
909908
// The minimum gas matches, if provided
910-
expected.min_gas.map_or(true, |min_gas| min_gas <= call.gas_limit)
909+
expected.min_gas.is_none_or(|min_gas| min_gas <= call.gas_limit)
911910
{
912911
*actual_count += 1;
913912
}
@@ -925,7 +924,7 @@ where {
925924
.iter_mut()
926925
.find(|(mock, _)| {
927926
call.input.get(..mock.calldata.len()) == Some(&mock.calldata[..]) &&
928-
mock.value.map_or(true, |value| Some(value) == call.transfer_value())
927+
mock.value.is_none_or(|value| Some(value) == call.transfer_value())
929928
})
930929
.map(|(_, v)| v),
931930
} {

crates/evm/evm/src/executors/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ impl Executor {
203203
.ok_or_else(|| BackendError::MissingAccount(DEFAULT_CREATE2_DEPLOYER))?;
204204

205205
// If the deployer is not currently deployed, deploy the default one.
206-
if create2_deployer_account.code.map_or(true, |code| code.is_empty()) {
206+
if create2_deployer_account.code.is_none_or(|code| code.is_empty()) {
207207
let creator = DEFAULT_CREATE2_DEPLOYER_DEPLOYER;
208208

209209
// Probably 0, but just in case.

crates/evm/traces/src/debug/sources.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl ArtifactData {
8888
fn new(bytecode: ContractBytecodeSome, build_id: String, file_id: u32) -> Result<Self> {
8989
let parse = |b: &Bytecode, name: &str| {
9090
// Only parse source map if it's not empty.
91-
let source_map = if b.source_map.as_ref().map_or(true, |s| s.is_empty()) {
91+
let source_map = if b.source_map.as_ref().is_none_or(|s| s.is_empty()) {
9292
Ok(None)
9393
} else {
9494
b.source_map().transpose().wrap_err_with(|| {

crates/fmt/src/comments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl CommentWithMetadata {
8888
return Self::new(
8989
comment,
9090
CommentPosition::Prefix,
91-
last_line.map_or(true, str::is_empty),
91+
last_line.is_none_or(str::is_empty),
9292
indent_len,
9393
)
9494
}

crates/forge/bin/cmd/coverage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ impl CoverageArgs {
293293
let file_pattern = filter.args().coverage_pattern_inverse.as_ref();
294294
let file_root = &filter.paths().root;
295295
report.filter_out_ignored_sources(|path: &Path| {
296-
file_pattern.map_or(true, |re| {
296+
file_pattern.is_none_or(|re| {
297297
!re.is_match(&path.strip_prefix(file_root).unwrap_or(path).to_string_lossy())
298298
})
299299
});

crates/script/src/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ impl PreprocessedState {
199199
if id.name != *name {
200200
continue;
201201
}
202-
} else if contract.abi.as_ref().map_or(true, |abi| abi.is_empty()) ||
203-
contract.bytecode.as_ref().map_or(true, |b| match &b.object {
202+
} else if contract.abi.as_ref().is_none_or(|abi| abi.is_empty()) ||
203+
contract.bytecode.as_ref().is_none_or(|b| match &b.object {
204204
BytecodeObject::Bytecode(b) => b.is_empty(),
205205
BytecodeObject::Unlinked(_) => false,
206206
})

crates/script/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ impl ScriptArgs {
278278
.execution_result
279279
.transactions
280280
.as_ref()
281-
.map_or(true, |txs| txs.is_empty())
281+
.is_none_or(|txs| txs.is_empty())
282282
{
283283
return Ok(());
284284
}

0 commit comments

Comments
 (0)