From 9ecb095f46fca4c331ecfb23d926b077520ad2ee Mon Sep 17 00:00:00 2001
From: alemi <me@alemi.dev>
Date: Wed, 29 Jan 2025 15:44:08 +0100
Subject: [PATCH] fix: rand moved things around

---
 routes/build.rs                | 1 +
 routes/src/activitypub/auth.rs | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/routes/build.rs b/routes/build.rs
index 6610daa..1875ad3 100644
--- a/routes/build.rs
+++ b/routes/build.rs
@@ -75,6 +75,7 @@ fn main() {
 	}
 }
 
+#[cfg(feature = "web")]
 fn if_matches_set_env_path(var: &str, f: &std::fs::DirEntry, fname: &str, first: &str, last: &str) -> bool {
 	if fname.starts_with(first) && fname.ends_with(last) {
 		match f.path().canonicalize() {
diff --git a/routes/src/activitypub/auth.rs b/routes/src/activitypub/auth.rs
index a9298b1..e7c7fb1 100644
--- a/routes/src/activitypub/auth.rs
+++ b/routes/src/activitypub/auth.rs
@@ -19,8 +19,8 @@ pub struct AuthSuccess {
 
 fn token() -> String {
 	// TODO should probably use crypto-safe rng
-	rand::thread_rng()
-		.sample_iter(&rand::distributions::Alphanumeric)
+	rand::rng()
+		.sample_iter(&rand::distr::Alphanumeric)
 		.take(128)
 		.map(char::from)
 		.collect()