Skip to content

Commit

Permalink
update to use rust 1.57.0 and edition2021 (#3114)
Browse files Browse the repository at this point in the history
* update to use rust 1.57.0

* chore: fix clippy

* fix clippy
  • Loading branch information
nanne007 authored Dec 24, 2021
1 parent f4baa90 commit a1766ad
Show file tree
Hide file tree
Showing 125 changed files with 147 additions and 168 deletions.
2 changes: 1 addition & 1 deletion abi/decoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "starcoin-abi-decoder"
version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion abi/resolver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "starcoin-abi-resolver"
version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion abi/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "starcoin-abi-types"
version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion account/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion account/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion account/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion block-relayer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion chain/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion chain/chain-notify/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion chain/mock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion chain/open-block/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion chain/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion cmd/airdrop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "airdrop"
version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion cmd/db-exporter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion cmd/faucet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion cmd/generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion cmd/genesis-nft-miner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
starcoin-rpc-api = {path = "../../rpc/api" }
Expand Down
2 changes: 1 addition & 1 deletion cmd/indexer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
authors = ["Starcoin Core Dev <[email protected]>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
name = "starcoin-indexer"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion cmd/merkle-generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "merkle-generator"
version = "1.9.0"
authors = ["caojiafeng <[email protected]>"]
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion cmd/miner_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "starcoin-miner-client"
version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion cmd/miner_client/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "starcoin-miner-client-api"
version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
9 changes: 5 additions & 4 deletions cmd/miner_client/src/stratum_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,18 @@ impl JobClient for StratumJobClient {
let blob = hex::decode(&job.blob);
let diff = target_hex_to_difficulty(&job.target);
let extra = job.get_extra();
let event = if blob.is_ok() && diff.is_ok() && extra.is_ok() {
let event = if let (Ok(blob), Ok(diff), Ok(extra)) = (blob, diff, extra) {
Some(MintBlockEvent {
parent_hash: Default::default(),
strategy: ConsensusStrategy::CryptoNight,
minting_blob: blob.expect(""),
difficulty: diff.expect(""),
minting_blob: blob,
difficulty: diff,
block_number: job.height,
extra: Some(MintEventExtra {
worker_id: job.id,
job_id: job.job_id,
extra: extra.expect(""),

extra,
}),
})
} else {
Expand Down
1 change: 1 addition & 0 deletions cmd/miner_client/src/stratum_client_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ pub struct JobNotification {
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
#[serde(untagged)]
#[allow(clippy::large_enum_variant)]
pub enum OutputResponse {
StratumJob(StratumJobResponse),
Status(Status),
Expand Down
2 changes: 1 addition & 1 deletion cmd/peer-watcher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[[bin]]
name = "starcoin_peer_watcher"
Expand Down
2 changes: 1 addition & 1 deletion cmd/replay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.8.0-rc.1"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[[bin]]
name = "starcoin_replay"
Expand Down
2 changes: 1 addition & 1 deletion cmd/resource-exporter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion cmd/starcoin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion cmd/tx-factory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[[bin]]
name = "starcoin_txfactory"
Expand Down
2 changes: 1 addition & 1 deletion commons/accumulator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"


[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion commons/api-limiter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "api-limiter"
version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
4 changes: 0 additions & 4 deletions commons/api-limiter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ pub struct ApiLimiter<User>
where
User: Clone + Hash + Eq,
{
global_quota: Quota,
user_quota: Quota,
global_limiter: DirectRateLimiter,
user_limiter: KeyedRateLimiter<User>,
}
Expand All @@ -31,8 +29,6 @@ where
Self {
global_limiter: DirectRateLimiter::direct(global_quota),
user_limiter: KeyedRateLimiter::keyed(user_quota),
global_quota,
user_quota,
}
}

Expand Down
2 changes: 1 addition & 1 deletion commons/bcs_ext/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion commons/crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
serde = { version = "1.0.130" }
Expand Down
2 changes: 1 addition & 1 deletion commons/crypto/crypto-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[lib]
proc-macro = true
Expand Down
2 changes: 1 addition & 1 deletion commons/decrypt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "starcoin-decrypt"
version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
edition = "2018"
edition = "2021"

[dependencies]
pbkdf2="0.3"
Expand Down
2 changes: 1 addition & 1 deletion commons/forkable-jellyfish-merkle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Diem Association <[email protected]>", "Starcoin Core Dev <dev@sta
description = "Diem jellyfish merkle"
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion commons/logger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
anyhow = "1.0.41"
Expand Down
2 changes: 1 addition & 1 deletion commons/metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"
description = "Starcoin metrics"

[dependencies]
Expand Down
1 change: 1 addition & 0 deletions commons/metrics/src/op_counters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ impl DurationHistogram {

#[derive(Clone)]
pub struct OpMetrics {
#[allow(unused)]
module: String,
counters: IntCounterVec,
gauges: IntGaugeVec,
Expand Down
2 changes: 1 addition & 1 deletion commons/proptest-helpers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.9.0"
authors = ["Starcoin Core Dev <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2018"
edition = "2021"

[dependencies]
crossbeam = "0.7.3"
Expand Down
Loading

0 comments on commit a1766ad

Please sign in to comment.