diff options
| author | Xe Iaso <me@christine.website> | 2022-07-10 20:54:37 +0000 |
|---|---|---|
| committer | Xe Iaso <me@christine.website> | 2022-07-10 20:54:37 +0000 |
| commit | 7dd708c6613b8e617fe77a6a8ad177485b39c258 (patch) | |
| tree | b3d3589e20f260d0c63d40abf94f9d02ec45a100 /src | |
| parent | 95016c89eb7707a476501f96327dcad11831b1a0 (diff) | |
| download | xesite-7dd708c6613b8e617fe77a6a8ad177485b39c258.tar.xz xesite-7dd708c6613b8e617fe77a6a8ad177485b39c258.zip | |
fix
Signed-off-by: Xe Iaso <me@christine.website>
Diffstat (limited to 'src')
| -rw-r--r-- | src/app/mod.rs | 8 | ||||
| -rw-r--r-- | src/handlers/mod.rs | 15 | ||||
| -rw-r--r-- | src/handlers/notes.rs | 7 |
3 files changed, 4 insertions, 26 deletions
diff --git a/src/app/mod.rs b/src/app/mod.rs index 24eabc5..4b52a90 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -1,6 +1,4 @@ use crate::{post::Post, signalboost::Person}; -use bb8::Pool; -use bb8_rusqlite::RusqliteConnectionManager; use chrono::prelude::*; use color_eyre::eyre::Result; use std::{env, fs, path::PathBuf, sync::Arc}; @@ -60,7 +58,6 @@ pub struct State { pub sitemap: Vec<u8>, pub patrons: Option<patreon::Users>, pub mi: mi::Client, - pub pool: Pool<RusqliteConnectionManager>, } pub async fn init(cfg: PathBuf) -> Result<State> { @@ -76,10 +73,6 @@ pub async fn init(cfg: PathBuf) -> Result<State> { let gallery = crate::post::load(cfg.clone(), "gallery").await?; let talks = crate::post::load(cfg.clone(), "talks").await?; let mut everything: Vec<Post> = vec![]; - let mgr = RusqliteConnectionManager::new( - env::var("DATABASE_URL").unwrap_or("./var/waifud.db".to_string()), - ); - let pool = bb8::Pool::builder().build(mgr).await?; { let blog = blog.clone(); @@ -157,7 +150,6 @@ pub async fn init(cfg: PathBuf) -> Result<State> { jf: jfb.build(), sitemap: sm, patrons: patrons().await?, - pool, }) } diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index 87175ca..97939fb 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -168,21 +168,6 @@ pub enum Error { #[error("database error: {0}")] SQLite(#[from] rusqlite::Error), - - #[error("database pool error: {0}")] - SQLitePool(#[from] bb8_rusqlite::Error), - - #[error("other error: {0}")] - Catchall(String), -} - -impl<E> From<bb8::RunError<E>> for Error -where - E: std::error::Error + Send + 'static, -{ - fn from(err: bb8::RunError<E>) -> Self { - Self::Catchall(format!("{}", err)) - } } pub type Result<T = Html<Vec<u8>>> = std::result::Result<T, Error>; diff --git a/src/handlers/notes.rs b/src/handlers/notes.rs index feb2129..f49ee39 100644 --- a/src/handlers/notes.rs +++ b/src/handlers/notes.rs @@ -20,12 +20,13 @@ impl Note { pub fn to_html(&self) -> Markup { html! { article."h-entry" { - time."dt-published" datetime=(self.created_at) { - {(self.detrytemci())} - } a href={"/notes/" (self.id)} { "🔗" } + " " + time."dt-published" datetime=(self.created_at) { + {(self.detrytemci())} + } @if let Some(reply_to) = &self.reply_to { p { |
