Skip to content

Conversation

@squadgazzz
Copy link
Contributor

Eliminates minor compilation warnings while using the generated smart contracts:

warning: accessing first element with log . topics.get(0)
--> /Users/squadgazzz/RustroverProjects/services/target/debug/build/contracts-3ef65e6ec386b1a7/out/IUniswapV3Factory.rs:1:29696
|
1 | ...ntract :: errors :: ExecutionError > { let standard_event = log . topics . get (0) . copied () . map (| topic | match topic { self :: ethcontract :: H256 ([198 , 106 , 63 , 223...
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: log . topics.first()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first

@squadgazzz squadgazzz force-pushed the reduce-compilcation-warnings branch from 337a89e to 1f8136b Compare November 15, 2023 10:47
@squadgazzz squadgazzz marked this pull request as ready for review November 15, 2023 12:30
@squadgazzz squadgazzz requested a review from a team November 15, 2023 12:36
Copy link
Contributor

@MartinquaXD MartinquaXD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is not much development happening in this repo. That's why I would suggest also bumping the crate's version number in this PR so we can immediately import the fixed version in the services repo.

.unwrap_or(&err.message)
}

#[allow(unused)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these allowed(unused) actually needed?
I believe we are exporting these types from the library clippy shouldn't care about them being used in the crate code.

Copy link
Contributor Author

@squadgazzz squadgazzz Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But for some reason, clippy shows unused warnings, probably because I use it with the --all-targets flag.

@squadgazzz squadgazzz merged commit da717d7 into main Nov 20, 2023
@squadgazzz squadgazzz deleted the reduce-compilcation-warnings branch November 20, 2023 09:40
squadgazzz added a commit to cowprotocol/services that referenced this pull request Nov 22, 2023
# Description
Reduces Rust compilation warnings. Remaining warnings related to
generated smart contracts will be fixed in
cowprotocol/ethcontract-rs#964
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants