Skip to content

Commit

Permalink
Upgrade to rust 1.65 (MystenLabs#5821)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwtian authored Nov 3, 2022
1 parent 264bc42 commit 351c752
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion crates/sui-core/tests/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn test_format() {

let status = std::process::Command::new("cargo")
.current_dir("..")
.args(&["run", "--example", "generate-format", "--"])
.args(["run", "--example", "generate-format", "--"])
.arg("test")
.status()
.expect("failed to execute process");
Expand Down
2 changes: 1 addition & 1 deletion crates/sui-open-rpc/tests/generate-spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn test_json_rpc_spec() {
// # cargo -q run --example generate-json-rpc-spec -- record
let status = std::process::Command::new("cargo")
.current_dir("..")
.args(&["run", "--example", "generate-json-rpc-spec", "--"])
.args(["run", "--example", "generate-json-rpc-spec", "--"])
.arg("test")
.status()
.expect("failed to execute process");
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-types/src/base_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,15 +623,15 @@ impl TryFrom<&[u8]> for ObjectDigest {

impl std::fmt::Debug for TransactionDigest {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
let s = Base64::encode(&self.0);
let s = Base64::encode(self.0);
write!(f, "{}", s)?;
Ok(())
}
}

impl std::fmt::Debug for TransactionEffectsDigest {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
let s = Base64::encode(&self.0);
let s = Base64::encode(self.0);
write!(f, "{}", s)?;
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion crates/sui-types/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ impl signature::Signature for Signature {

impl std::fmt::Debug for Signature {
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), std::fmt::Error> {
let flag = Base64::encode(&[self.scheme().flag()]);
let flag = Base64::encode([self.scheme().flag()]);
let s = Base64::encode(self.signature_bytes());
let p = Base64::encode(self.public_key_bytes());
write!(f, "{flag}@{s}@{p}")?;
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-types/src/unit_tests/base_types_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

#![allow(clippy::blacklisted_name)]
#![allow(clippy::disallowed_names)]

use std::str::FromStr;

Expand Down Expand Up @@ -280,7 +280,7 @@ fn test_transaction_digest_serde_not_human_readable() {
fn test_transaction_digest_serde_human_readable() {
let digest = TransactionDigest::random();
let serialized = serde_json::to_string(&digest).unwrap();
assert_eq!(format!("\"{}\"", Base64::encode(&digest.0)), serialized);
assert_eq!(format!("\"{}\"", Base64::encode(digest.0)), serialized);
let deserialized: TransactionDigest = serde_json::from_str(&serialized).unwrap();
assert_eq!(deserialized, digest);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/sui/tests/reconfiguration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ async fn reconfig_last_checkpoint_sync_missing_tx() {
// Check that the object is mutated on validator 0 only.
assert_eq!(
get_object(validator, object_ref.0).await.version(),
SequenceNumber::from(if idx == 0 { 1 } else { 0 })
SequenceNumber::from(u64::from(idx == 0))
);
}

Expand Down
2 changes: 1 addition & 1 deletion docker/sui-node/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.64.0 AS chef
FROM rust:1.65.0 AS chef
ARG PROFILE=release
WORKDIR sui
RUN apt-get update && apt-get install -y cmake clang
Expand Down
2 changes: 1 addition & 1 deletion docker/sui-tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.64.0 AS chef
FROM rust:1.65.0 AS chef
WORKDIR sui
ARG GIT_REVISION
ENV GIT_REVISION=$GIT_REVISION
Expand Down
2 changes: 1 addition & 1 deletion narwhal/Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG BUILD_MODE="release"
#################################################################
# Stage 0
#################################################################
FROM rust:1.64.0 AS chef
FROM rust:1.65.0 AS chef
WORKDIR "$WORKDIR/sui"
ARG BUILD_MODE

Expand Down
6 changes: 3 additions & 3 deletions narwhal/types/src/primary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ impl Hash<{ crypto::DIGEST_LENGTH }> for Header {
fn digest(&self) -> HeaderDigest {
let mut hasher = crypto::DefaultHashFunction::new();
hasher.update(&self.author);
hasher.update(&self.round.to_le_bytes());
hasher.update(self.round.to_le_bytes());
hasher.update(self.epoch.to_le_bytes());
for (x, y) in self.payload.iter() {
hasher.update(Digest::from(*x));
Expand Down Expand Up @@ -446,8 +446,8 @@ impl Hash<{ crypto::DIGEST_LENGTH }> for Vote {
fn digest(&self) -> VoteDigest {
let mut hasher = crypto::DefaultHashFunction::default();
hasher.update(Digest::from(self.id));
hasher.update(&self.round.to_le_bytes());
hasher.update(&self.epoch.to_le_bytes());
hasher.update(self.round.to_le_bytes());
hasher.update(self.epoch.to_le_bytes());
hasher.update(&self.origin);
VoteDigest(hasher.finalize().into())
}
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.64.0
1.65.0

0 comments on commit 351c752

Please sign in to comment.