mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 18:15:39 +00:00
migrated auth, account and meta to use const routes
This commit is contained in:
@@ -15,23 +15,33 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
|
||||
use super::account::routes::Account;
|
||||
use super::auth::routes::Auth;
|
||||
use super::mcaptcha::duration::routes::Duration;
|
||||
use super::mcaptcha::levels::routes::Levels;
|
||||
use super::mcaptcha::mcaptcha::routes::MCaptcha;
|
||||
use super::meta::routes::Meta;
|
||||
|
||||
lazy_static! {
|
||||
pub static ref ROUTES: Routes = Routes::default();
|
||||
}
|
||||
pub const ROUTES: Routes = Routes::new();
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Routes {
|
||||
pub auth: Auth,
|
||||
pub account: Account,
|
||||
pub levels: Levels,
|
||||
pub mcaptcha: MCaptcha,
|
||||
pub duration: Duration,
|
||||
pub meta: Meta,
|
||||
}
|
||||
|
||||
impl Routes {
|
||||
const fn new() -> Routes {
|
||||
Routes {
|
||||
auth: Auth::new(),
|
||||
account: Account::new(),
|
||||
levels: Levels::new(),
|
||||
mcaptcha: MCaptcha::new(),
|
||||
duration: Duration::new(),
|
||||
meta: Meta::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user