migrated auth, account and meta to use const routes

This commit is contained in:
realaravinth
2021-05-02 16:11:01 +05:30
parent 4f27e1ab8d
commit 76ae2b03e9
19 changed files with 626 additions and 70 deletions

View File

@@ -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(),
}
}
}