Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
Hampton Moore committed Jan 16, 2024
1 parent b564388 commit 6e16ee1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 25 deletions.
20 changes: 11 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
use axum::{response::Html, routing::get, Router};
use axum::{
extract::Request,
middleware::{self, Next},
response::Html,
response::Response,
routing::get,
Router,
};

use axum_extra::extract::cookie::CookieJar;

use log::{error, info};
use std::sync::Arc;
use tokio::sync::RwLock;
Expand Down Expand Up @@ -78,14 +88,6 @@ async fn main() {
axum::serve(listener, app).await.unwrap();
}

use axum::{
extract::Request,
middleware::{self, Next},
response::Response,
};

use axum_extra::extract::cookie::{CookieJar};

async fn middleware_apply_client_state(
jar: CookieJar,
mut request: Request,
Expand Down
7 changes: 1 addition & 6 deletions src/site/things.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,5 @@ pub async fn index(
}
};

base(
"Things".to_owned(),
content,
state.clone(),
client_state,
)
base("Things".to_owned(), content, state.clone(), client_state)
}
9 changes: 2 additions & 7 deletions src/site/words.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use maud::{html, Markup, PreEscaped};
use std::sync::Arc;
use tokio::sync::RwLock;

use crate::words::{get};
use crate::words::get;

pub async fn index(
State(state): State<Arc<RwLock<SiteState>>>,
Expand Down Expand Up @@ -37,12 +37,7 @@ pub async fn index(
}
};

base(
"Posts".to_owned(),
content,
state.clone(),
client_state,
)
base("Posts".to_owned(), content, state.clone(), client_state)
}

pub async fn post(
Expand Down
3 changes: 0 additions & 3 deletions src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use comrak::{markdown_to_html, ComrakOptions};
use kuchiki::traits::*;




pub fn md_to_html(md: &str) -> String {
let mut options = ComrakOptions::default();
options.render.unsafe_ = true;
Expand Down

0 comments on commit 6e16ee1

Please sign in to comment.