Skip to content

Commit e4480fc

Browse files
committed
Add jealousy^W^Wconvert to dotenvy
1 parent 931cdfb commit e4480fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/models/helpers/admin.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ use once_cell::sync::Lazy;
55
use crate::util::errors::{forbidden, AppResult};
66

77
static AUTHORIZED_ADMIN_USER_IDS: Lazy<HashSet<i32>> =
8-
Lazy::new(|| parse_authorized_admin_users(dotenv::var("GH_ADMIN_USER_IDS")));
8+
Lazy::new(|| parse_authorized_admin_users(dotenvy::var("GH_ADMIN_USER_IDS")));
99

1010
// The defaults correspond to the current crates.io team, which as at the time of writing, is the
1111
// GitHub user names carols10cents, jtgeibel, Turbo87, JohnTitor, LawnGnome, and mdtro.
1212
//
1313
// FIXME: this needs to be removed once we can detect the admins from the Rust teams API.
1414
const DEFAULT_ADMIN_USER_IDS: [i32; 6] = [193874, 22186, 141300, 25030997, 229984, 20070360];
1515

16-
fn parse_authorized_admin_users(maybe_users: dotenv::Result<String>) -> HashSet<i32> {
16+
fn parse_authorized_admin_users(maybe_users: dotenvy::Result<String>) -> HashSet<i32> {
1717
match maybe_users {
1818
Ok(users) => users
1919
.split(|c: char| !(c.is_ascii_digit()))
@@ -70,7 +70,7 @@ mod tests {
7070

7171
#[test]
7272
fn test_parse_authorized_admin_users() {
73-
fn assert_authorized(input: dotenv::Result<&str>, expected: &[i32]) {
73+
fn assert_authorized(input: dotenvy::Result<&str>, expected: &[i32]) {
7474
assert_eq!(
7575
parse_authorized_admin_users(input.map(String::from)),
7676
expected.iter().copied().collect()
@@ -84,7 +84,7 @@ mod tests {
8484
assert_authorized(Ok("12345;6789"), &[12345, 6789]);
8585
assert_authorized(Ok("12345;6789;12345"), &[12345, 6789]);
8686

87-
let not_found_error = dotenv::Error::Io(io::Error::new(ErrorKind::NotFound, "not found"));
87+
let not_found_error = dotenvy::Error::Io(io::Error::new(ErrorKind::NotFound, "not found"));
8888
assert_authorized(Err(not_found_error), DEFAULT_ADMIN_USER_IDS.as_slice());
8989
}
9090
}

0 commit comments

Comments
 (0)