Skip to content

Commit

Permalink
cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kentSarmiento committed Dec 27, 2023
1 parent 924ebf8 commit a53d325
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
7 changes: 3 additions & 4 deletions link-for-later/src/app.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::sync::Arc;
use std::{error, fmt};
use std::{error, fmt, sync::Arc};

use axum::Router;

Expand Down Expand Up @@ -28,8 +27,8 @@ pub fn new(db: Database) -> Router {

let state = State::new(links_service, users_service, links_repo, users_repo);
Router::new()
.merge(controller::routes::links::routes(state.clone()))
.merge(controller::routes::users::routes(state.clone()))
.merge(controller::routes::links::router(state.clone()))
.merge(controller::routes::users::router(state.clone()))
.with_state(state)
}

Expand Down
2 changes: 1 addition & 1 deletion link-for-later/src/controller/routes/links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
types::{AppError, AppState},
};

pub fn routes(state: AppState) -> Router<AppState> {
pub fn router(state: AppState) -> Router<AppState> {
Router::new()
.nest(
"/v1",
Expand Down
2 changes: 1 addition & 1 deletion link-for-later/src/controller/routes/users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
types::{AppError, AppState},
};

pub fn routes(state: AppState) -> Router<AppState> {
pub fn router(state: AppState) -> Router<AppState> {
Router::new()
.nest(
"/v1",
Expand Down
2 changes: 1 addition & 1 deletion link-for-later/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![warn(clippy::all, clippy::pedantic, clippy::nursery, clippy::cargo)]

pub use crate::types::Database as DatabaseType;
pub use types::Database as DatabaseType;
pub mod app;

mod controller;
Expand Down
6 changes: 2 additions & 4 deletions link-for-later/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use crate::app;

pub type Result<T> = std::result::Result<T, AppError>;

pub type AppState = app::State;
pub type AppError = app::Error;
pub type AppState = crate::app::State;
pub type AppError = crate::app::Error;

pub enum Database {
MongoDb(mongodb::Database),
Expand Down

0 comments on commit a53d325

Please sign in to comment.