From 70998811732ff46fab19b7d34a350224a8b5bc2e Mon Sep 17 00:00:00 2001 From: 0xf8 <0xf8.dev@proton.me> Date: Wed, 21 Jun 2023 18:07:52 -0400 Subject: [PATCH] Remove try_exists feature --- src/dbtool/passwd.rs | 0 src/lib.rs | 2 -- src/main.rs | 2 -- src/main_dbtool.rs | 2 -- src/server/{api => admin}/mod.rs | 14 -------------- src/server/user/mod.rs | 26 -------------------------- src/util/config.rs | 2 +- 7 files changed, 1 insertion(+), 47 deletions(-) create mode 100644 src/dbtool/passwd.rs rename src/server/{api => admin}/mod.rs (71%) delete mode 100644 src/server/user/mod.rs diff --git a/src/dbtool/passwd.rs b/src/dbtool/passwd.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/lib.rs b/src/lib.rs index 0b4c27c..c86315b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,8 +9,6 @@ * You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#![feature(fs_try_exists)] - pub use util::*; mod util; diff --git a/src/main.rs b/src/main.rs index 012ab4b..042f626 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,8 +9,6 @@ * You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#![feature(fs_try_exists)] - use anyhow::{bail, Result}; use dotenvy::dotenv; use log::{info, warn}; diff --git a/src/main_dbtool.rs b/src/main_dbtool.rs index bcaee96..678e992 100644 --- a/src/main_dbtool.rs +++ b/src/main_dbtool.rs @@ -9,8 +9,6 @@ * You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#![feature(fs_try_exists)] - use anyhow::{bail, Result}; use dotenvy::dotenv; use log::error; diff --git a/src/server/api/mod.rs b/src/server/admin/mod.rs similarity index 71% rename from src/server/api/mod.rs rename to src/server/admin/mod.rs index 1fd6552..390834e 100644 --- a/src/server/api/mod.rs +++ b/src/server/admin/mod.rs @@ -9,17 +9,3 @@ * You should have received a copy of the GNU General Public License along with this program. If not, see . */ -pub use log::{info, log, warn}; -pub use tide::{Middleware, prelude::*, Request, Response, Result, utils::After}; - -pub use yggdrasil::*; - -pub fn nest(db: Database) -> tide::Server { - info!("Loading nest"); - - let mut nest = tide::with_state(db.to_owned()); - - - - nest -} \ No newline at end of file diff --git a/src/server/user/mod.rs b/src/server/user/mod.rs deleted file mode 100644 index c30675c..0000000 --- a/src/server/user/mod.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Yggdrasil: Minecraft authentication server - * Copyright (C) 2023 0xf8.dev@proton.me - * - * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with this program. If not, see . - */ - -pub use log::{info, log, warn}; -pub use tide::{Middleware, prelude::*, Request, Response, Result, utils::After}; - -pub use yggdrasil::*; - -pub fn nest(db: Database) -> tide::Server { - info!("Loading nest"); - - let mut nest = tide::with_state(db.to_owned()); - - nest.at("/profile").nest(super::profile::nest(db.to_owned())); - nest.at("/profiles").nest(super::profile::nest(db.to_owned())); - - nest -} diff --git a/src/util/config.rs b/src/util/config.rs index 3d1f31a..ab0f422 100644 --- a/src/util/config.rs +++ b/src/util/config.rs @@ -88,7 +88,7 @@ impl Config { debug!("Determined config file to be at {}", config_file.display()); - if !fs::try_exists(&config_file)? { + if !config_file.exists() { return Self::new(&config_file); }