Skip to content

Commit

Permalink
Cargo updates to resolver, fmt, and rustc toolchain bump (#2288)
Browse files Browse the repository at this point in the history
* Fix lints

* Resolver, toolchain and cleanups
prasannavl authored Aug 5, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent ac9d063 commit 0665db4
Showing 7 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions lib/.rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
unstable_features = true
group_imports = "StdExternalCrate"
2 changes: 2 additions & 0 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -9,6 +9,8 @@ default-members = [
"ain-*",
]

resolver = "2"

[profile.release]
lto = true

5 changes: 4 additions & 1 deletion lib/Makefile.am
Original file line number Diff line number Diff line change
@@ -74,9 +74,12 @@ test:
clippy:
$(CARGO) clippy $(CARGO_MANIFEST_ARG) $(CARGO_EXTRA_ARGS) -- -Dwarnings

# We ignore unstable warnings for fmt to enable the use of backward
# compatible nightly features. Stricly backward compatible only, or will
# cause conflicts across toolchains
.PHONY: fmt-check
fmt-check:
$(CARGO) fmt $(CARGO_MANIFEST_ARG) --all --check
$(CARGO) fmt $(CARGO_MANIFEST_ARG) --all --check 2> >(grep -v -E 'group_imports|unstable_features')

.PHONY: fmt
fmt:
2 changes: 1 addition & 1 deletion lib/ain-evm/src/log.rs
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ impl LogService {
};

for log in logs {
let map = logs_map.entry(log.address).or_insert(Vec::new());
let map = logs_map.entry(log.address).or_default();

map.push(LogIndex {
block_hash: receipt.block_hash,
2 changes: 1 addition & 1 deletion lib/ain-evm/src/storage/code.rs
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ impl CodeHistory {
self.code_map.insert(code_hash, code);
self.history
.entry(block_number)
.or_insert_with(Vec::new)
.or_default()
.push(code_hash);
}

4 changes: 1 addition & 3 deletions lib/ain-evm/src/storage/data_handler.rs
Original file line number Diff line number Diff line change
@@ -205,9 +205,7 @@ impl LogStorage for BlockchainDataHandler {
fn put_logs(&self, address: H160, logs: Vec<LogIndex>, block_number: U256) {
let mut address_logs_map = self.address_logs_map.write().unwrap();

let address_map = address_logs_map
.entry(block_number)
.or_insert(HashMap::new());
let address_map = address_logs_map.entry(block_number).or_default();
address_map.insert(address, logs);
}
}
2 changes: 1 addition & 1 deletion make.sh
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ setup_vars() {
PYTHON_VENV_DIR=${PYTHON_VENV_DIR:-"${BUILD_DIR}/pyenv"}

CLANG_DEFAULT_VERSION=${CLANG_DEFAULT_VERSION:-"15"}
RUST_DEFAULT_VERSION=${RUST_DEFAULT_VERSION:-"1.70"}
RUST_DEFAULT_VERSION=${RUST_DEFAULT_VERSION:-"1.71"}

MAKE_DEBUG=${MAKE_DEBUG:-"1"}
MAKE_USE_CLANG=${MAKE_USE_CLANG:-"$(get_default_use_clang)"}

0 comments on commit 0665db4

Please sign in to comment.