Skip to content

Commit

Permalink
Bump Rust to 1.75.0 (#5087)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Dec 31, 2023
1 parent 10910fc commit c0e5160
Show file tree
Hide file tree
Showing 15 changed files with 11 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM ubuntu:22.04 as builder
SHELL ["bash", "-c"]

ARG git_commit_id
ARG rust_version=1.73.0
ARG rust_version=1.75.0

ENV GIT_COMMIT_ID=$git_commit_id
ENV TZ=UTC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ async fn make_payment(ledger_canister: CanisterId, transfer_args: TransferArg) -

fn memo(reason: PendingPaymentReason) -> Memo {
match reason {
PendingPaymentReason::AccessGate => MEMO_JOINING_FEE.to_vec().try_into().unwrap(),
PendingPaymentReason::AccessGate => MEMO_JOINING_FEE.to_vec().into(),
}
}
2 changes: 0 additions & 2 deletions backend/canisters/cycles_dispenser/api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
mod lifecycle;
mod queries;
mod updates;

pub use lifecycle::*;
pub use queries::*;
pub use updates::*;
1 change: 0 additions & 1 deletion backend/canisters/cycles_dispenser/api/src/queries/mod.rs

This file was deleted.

2 changes: 0 additions & 2 deletions backend/canisters/escrow/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ use sha256::sha256;
use types::UserId;

mod lifecycle;
mod queries;
mod updates;

pub use lifecycle::*;
pub use queries::*;
pub use updates::*;

pub fn deposit_subaccount(user_id: UserId, offer_id: u32) -> Subaccount {
Expand Down
1 change: 0 additions & 1 deletion backend/canisters/escrow/api/src/queries/mod.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ async fn make_payment(ledger_canister: CanisterId, transfer_args: TransferArg) -

fn memo(reason: PendingPaymentReason) -> Memo {
match reason {
PendingPaymentReason::AccessGate => MEMO_JOINING_FEE.to_vec().try_into().unwrap(),
PendingPaymentReason::AccessGate => MEMO_JOINING_FEE.to_vec().into(),
}
}
2 changes: 0 additions & 2 deletions backend/canisters/neuron_controller/api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
mod lifecycle;
mod queries;
mod updates;

pub use lifecycle::*;
pub use queries::*;
pub use updates::*;
1 change: 0 additions & 1 deletion backend/canisters/neuron_controller/api/src/queries/mod.rs

This file was deleted.

2 changes: 1 addition & 1 deletion backend/canisters/proposals_bot/impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ fn generate_message_id(governance_canister_id: CanisterId, proposal_id: Proposal
hash.update(b"proposals_bot");
hash.update(governance_canister_id.as_slice());
hash.update(proposal_id.to_ne_bytes());
let array32: [u8; 32] = hash.finalize().try_into().unwrap();
let array32: [u8; 32] = hash.finalize().into();
let array16: [u8; 16] = array32[..16].try_into().unwrap();
u128::from_ne_bytes(array16).into()
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async fn make_payment(pending_payment: &PendingPayment) -> Result<BlockIndex, bo
to: pending_payment.recipient_account,
fee: None,
created_at_time: Some(pending_payment.timestamp),
memo: Some(pending_payment.memo.to_vec().try_into().unwrap()),
memo: Some(pending_payment.memo.to_vec().into()),
amount: pending_payment.amount.into(),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fn get_batched_events_succeeds() {
},
);

assert_is_message_with_text(responses.get(0).unwrap(), "User: 0");
assert_is_message_with_text(responses.first().unwrap(), "User: 0");
assert_is_message_with_text(responses.get(1).unwrap(), "Group1: 1");
assert_is_message_with_text(responses.get(2).unwrap(), "Group2: 2");
assert_is_message_with_text(responses.get(3).unwrap(), "Channel: 3");
Expand Down Expand Up @@ -123,13 +123,13 @@ fn get_batched_summaries_succeeds() {
},
);

assert_is_summary_with_id(responses.get(0).unwrap(), group_id1.into(), false);
assert_is_summary_with_id(responses.first().unwrap(), group_id1.into(), false);
assert_is_summary_with_id(responses.get(1).unwrap(), group_id2.into(), false);
assert_is_summary_with_id(responses.get(2).unwrap(), community_id.into(), true);
}

fn assert_is_message_with_text(response: &EventsResponse, text: &str) {
if let local_user_index_canister::chat_events::EventsResponse::Success(result) = response {
if let EventsResponse::Success(result) = response {
assert_eq!(result.events.len(), 1);
if let ChatEvent::Message(message) = &result.events.first().unwrap().event {
assert_eq!(message.content.text().unwrap(), text);
Expand Down
2 changes: 1 addition & 1 deletion backend/libraries/candid_gen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub fn generate_candid_method_no_args(input: TokenStream) -> TokenStream {
}

fn get_method_attribute(inputs: Vec<String>) -> MethodAttribute {
let first_arg = inputs.get(0).unwrap();
let first_arg = inputs.first().unwrap();
let second_arg = inputs.get(1).unwrap();
let third_arg = inputs.get(2).unwrap();

Expand Down
2 changes: 1 addition & 1 deletion backend/libraries/canister_api_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ fn get_arg_names(signature: &Signature) -> Vec<Ident> {
}

fn get_validation_method_attribute(inputs: Vec<String>) -> ValidationMethodAttribute {
let service_name = inputs.get(0).unwrap().to_string();
let service_name = inputs.first().unwrap().to_string();
let function_name = inputs.get(1).unwrap().to_string();

ValidationMethodAttribute {
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.73.0"
channel = "1.75.0"
targets = ["wasm32-unknown-unknown"]

0 comments on commit c0e5160

Please sign in to comment.