Skip to content

Commit

Permalink
Bump Rust version to 1.76.0 (#5340)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Feb 8, 2024
1 parent fbd5050 commit 8eedad4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 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.75.0
ARG rust_version=1.76.0
ARG canister_name

ENV GIT_COMMIT_ID=$git_commit_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async fn send_prizes_impl() {

async fn send_next_prize() -> bool {
// 1. Read a bunch of data from the runtime state, pick a random group and prize
let (ledger_canister_id, group, token, prize, end_date, now_nanos, bot_name) = match mutate_state(|state| {
let Some((ledger_canister_id, group, token, prize, end_date, now_nanos, bot_name)) = mutate_state(|state| {
if !state.data.started {
error!("Not started");
return None;
Expand Down Expand Up @@ -64,9 +64,8 @@ async fn send_next_prize() -> bool {
}

None
}) {
Some(t) => t,
None => return false,
}) else {
return false;
};

// 2. Transfer the prize funds to the group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ fn prepare(args: Args, state: &RuntimeState) -> Result<PrepareResult, Response>
}
}

fn default_channels_valid(default_channels: &Vec<String>) -> bool {
fn default_channels_valid(default_channels: &[String]) -> bool {
if default_channels.is_empty()
|| default_channels
.iter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ use utils::time::DAY_IN_MS;
#[update(guard = "caller_is_openchat_user")]
#[trace]
async fn pay_for_diamond_membership(args: Args) -> Response {
let user_id = match read_state(|state| {
let Some(user_id) = read_state(|state| {
let caller = state.env.caller();
state.data.users.get_by_principal(&caller).map(|u| u.user_id)
}) {
Some(u) => u,
_ => return UserNotFound,
}) else {
return UserNotFound;
};

pay_for_diamond_membership_impl(args, user_id, true).await
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.75.0"
channel = "1.76.0"
targets = ["wasm32-unknown-unknown"]

0 comments on commit 8eedad4

Please sign in to comment.