Skip to content

Commit 96582ec

Browse files
committed
Require rustc 1.85 and make required changes
1 parent 6c7c60d commit 96582ec

File tree

7 files changed

+111
-35
lines changed

7 files changed

+111
-35
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ jobs:
1717
env:
1818
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1919
with:
20+
TOOLCHAIN_VERSION: 1.85.0
2021
RUSTTARGET: ${{ matrix.target }}
2122
EXTRA_FILES: "README.md LICENSE"

Cargo.lock

Lines changed: 93 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "wastebin"
33
version = "2.7.1"
4-
edition = "2021"
5-
rust-version = "1.83"
4+
edition = "2024"
5+
rust-version = "1.85"
66

77
[dependencies]
88
askama = { version = "0.12", default-features = false, features = ["with-axum"] }
@@ -19,7 +19,7 @@ http = "1.1.0"
1919
mime = "0.3"
2020
qrcodegen = "1"
2121
parking_lot = "0.12.1"
22-
rand = "0.8"
22+
rand = "0.9"
2323
rusqlite = { version = "0.32", features = ["bundled"] }
2424
rusqlite_migration = { version = "1", default-features = false }
2525
rust-argon2 = "2.0.0"

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# --- build image
22

3-
FROM rust:1.84 AS builder
3+
FROM rust:1.85 AS builder
44

55
RUN rustup target add x86_64-unknown-linux-musl
66
RUN apt update && apt install -y musl-tools musl-dev

Dockerfile.arm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# --- build image
2-
FROM rust:1.83 AS builder
2+
FROM rust:1.85 AS builder
33

44
RUN rustup target add aarch64-unknown-linux-musl && \
55
apt-get update && \

src/handlers/insert/api.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use crate::db::{write, Database};
1+
use crate::db::{Database, write};
22
use crate::errors::{Error, JsonErrorResponse};
33
use crate::id::Id;
4-
use axum::extract::State;
54
use axum::Json;
5+
use axum::extract::State;
66
use rand::Rng;
77
use serde::{Deserialize, Serialize};
88
use std::num::NonZeroU32;
@@ -40,13 +40,10 @@ pub async fn post(
4040
State(db): State<Database>,
4141
Json(entry): Json<Entry>,
4242
) -> Result<Json<RedirectResponse>, JsonErrorResponse> {
43-
let id: Id = tokio::task::spawn_blocking(|| {
44-
let mut rng = rand::thread_rng();
45-
rng.gen::<u32>()
46-
})
47-
.await
48-
.map_err(Error::from)?
49-
.into();
43+
let id: Id = tokio::task::spawn_blocking(|| rand::rng().random::<u32>())
44+
.await
45+
.map_err(Error::from)?
46+
.into();
5047

5148
let entry: write::Entry = entry.into();
5249
let path = format!("/{}", id.to_url_path(&entry));

src/handlers/insert/form.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::db::{write, Database};
1+
use crate::db::{Database, write};
22
use crate::handlers::extract::Theme;
33
use crate::handlers::html::make_error;
44
use crate::id::Id;
@@ -65,13 +65,10 @@ pub async fn post(
6565
.unwrap_or(false);
6666

6767
async {
68-
let id: Id = tokio::task::spawn_blocking(|| {
69-
let mut rng = rand::thread_rng();
70-
rng.gen::<u32>()
71-
})
72-
.await
73-
.map_err(Error::from)?
74-
.into();
68+
let id: Id = tokio::task::spawn_blocking(|| rand::rng().random::<u32>())
69+
.await
70+
.map_err(Error::from)?
71+
.into();
7572

7673
// Retrieve uid from cookie or generate a new one.
7774
let uid = if let Some(cookie) = jar.get("uid") {
@@ -110,7 +107,7 @@ pub async fn post(
110107
#[cfg(test)]
111108
mod tests {
112109
use crate::test_helpers::Client;
113-
use reqwest::{header, StatusCode};
110+
use reqwest::{StatusCode, header};
114111
use std::collections::HashMap;
115112

116113
#[tokio::test]

0 commit comments

Comments
 (0)