Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: misc stuff #6439

Merged
merged 6 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/cast/bin/cmd/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl RunArgs {
update_progress!(pb, index);
continue
}
if tx.hash.eq(&tx_hash) {
if tx.hash == tx_hash {
break
}

Expand Down
6 changes: 3 additions & 3 deletions crates/common/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ impl ProjectCompiler {

let dev_functions =
artifact.abi.as_ref().map(|abi| abi.functions()).into_iter().flatten().filter(
|func| {
|&func| {
func.name.is_test() ||
func.name.eq("IS_TEST") ||
func.name.eq("IS_SCRIPT")
func.name == "IS_TEST" ||
func.name == "IS_SCRIPT"
},
);

Expand Down
6 changes: 3 additions & 3 deletions crates/doc/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ impl DocBuilder {
}
// Sort entries by path depth
let grouped = grouped.into_iter().sorted_by(|(lhs, _), (rhs, _)| {
let lhs_at_end = lhs.extension().map(|ext| ext.eq(Self::SOL_EXT)).unwrap_or_default();
let rhs_at_end = rhs.extension().map(|ext| ext.eq(Self::SOL_EXT)).unwrap_or_default();
let lhs_at_end = lhs.extension().map(|ext| ext == Self::SOL_EXT).unwrap_or_default();
let rhs_at_end = rhs.extension().map(|ext| ext == Self::SOL_EXT).unwrap_or_default();
if lhs_at_end == rhs_at_end {
lhs.cmp(rhs)
} else if lhs_at_end {
Expand All @@ -421,7 +421,7 @@ impl DocBuilder {

let mut readme = BufWriter::new("\n\n# Contents\n");
for (path, files) in grouped {
if path.extension().map(|ext| ext.eq(Self::SOL_EXT)).unwrap_or_default() {
if path.extension().map(|ext| ext == Self::SOL_EXT).unwrap_or_default() {
for file in files {
let ident = &file.identity;

Expand Down
2 changes: 1 addition & 1 deletion crates/doc/src/parser/comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl Comment {
pub fn match_first_word(&self, expected: &str) -> Option<&str> {
self.split_first_word().and_then(
|(word, rest)| {
if word.eq(expected) {
if word == expected {
Some(rest)
} else {
None
Expand Down
2 changes: 1 addition & 1 deletion crates/evm/core/src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ impl Backend {
continue
}

if tx.hash.eq(&tx_hash.to_ethers()) {
if tx.hash == tx_hash.to_ethers() {
// found the target transaction
return Ok(Some(tx))
}
Expand Down
2 changes: 1 addition & 1 deletion crates/fmt/src/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ impl<'a, W: Write> Formatter<'a, W> {
first_char == ch &&
state == CommentState::None &&
idx + needle.len() <= subset.len() &&
subset[idx..idx + needle.len()].eq(needle)
subset[idx..idx + needle.len()] == *needle
})
.map(|p| byte_offset + p)
})
Expand Down
2 changes: 1 addition & 1 deletion crates/fmt/src/solang_ext/ast_eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ where
impl AstEq for String {
fn ast_eq(&self, other: &Self) -> bool {
match (Address::from_str(self), Address::from_str(other)) {
(Ok(left), Ok(right)) => left.eq(&right),
(Ok(left), Ok(right)) => left == right,
_ => self == other,
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/forge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ foundry-test-utils.workspace = true

criterion = "0.5"
globset = "0.4"
paste = "1.0"
path-slash = "0.2"
pretty_assertions.workspace = true
serial_test = "2"
Expand Down
4 changes: 1 addition & 3 deletions crates/forge/bin/cmd/inspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl InspectArgs {

// Map field to ContractOutputSelection
let mut cos = build.compiler.extra_output;
if !field.is_default() && !cos.iter().any(|selected| field.eq(selected)) {
if !field.is_default() && !cos.iter().any(|selected| field == *selected) {
cos.push(field.into());
}

Expand Down Expand Up @@ -165,7 +165,6 @@ impl InspectArgs {
ContractArtifactField::Errors => {
let mut out = serde_json::Map::new();
if let Some(abi) = &artifact.abi {
let abi = &abi;
// Print the signature of all errors
for er in abi.errors.iter().flat_map(|(_, errors)| errors) {
let types = er.inputs.iter().map(|p| p.ty.clone()).collect::<Vec<_>>();
Expand All @@ -182,7 +181,6 @@ impl InspectArgs {
ContractArtifactField::Events => {
let mut out = serde_json::Map::new();
if let Some(abi) = &artifact.abi {
let abi = &abi;
// print the signature of all events including anonymous
for ev in abi.events.iter().flat_map(|(_, events)| events) {
let types = ev.inputs.iter().map(|p| p.ty.clone()).collect::<Vec<_>>();
Expand Down
7 changes: 4 additions & 3 deletions crates/forge/tests/it/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl TestConfig {
/// * filter matched 0 test cases
/// * a test results deviates from the configured `should_fail` setting
pub async fn try_run(&mut self) -> eyre::Result<()> {
let suite_result = self.runner.test(&self.filter, None, self.opts.clone()).await;
let suite_result = self.test().await;
if suite_result.is_empty() {
eyre::bail!("empty test result");
}
Expand Down Expand Up @@ -259,8 +259,9 @@ pub fn assert_multiple(
}

if let Some(expected_logs) = expected_logs {
assert!(
logs.iter().eq(expected_logs.iter()),
assert_eq!(
logs,
expected_logs,
"Logs did not match for test {}.\nExpected:\n{}\n\nGot:\n{}",
test_name,
expected_logs.join("\n"),
Expand Down
Loading
Loading