mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 10:26:21 +00:00
feat(backend) cargo fmt & migration to rust 2024
This commit is contained in:
15 files changed
+22
-23
No files matched your search
@@ -1,8 +1,8 @@
|
||||
use crate::constants::blog::PAGE_SIZE;
|
||||
|
||||
use axum::{extract::State, Json};
|
||||
use serde_json::{json, Value};
|
||||
use sqlx::{query, PgPool, Row};
|
||||
use axum::{Json, extract::State};
|
||||
use serde_json::{Value, json};
|
||||
use sqlx::{PgPool, Row, query};
|
||||
use tracing::error;
|
||||
|
||||
const GET_PAGE_COUNT_QUERY: &str = include_str!("post_page_count.sql");
|
||||
|
||||
@@ -2,8 +2,8 @@ use macros::dev_consume;
|
||||
|
||||
use axum::response::IntoResponse;
|
||||
use axum::{
|
||||
extract::{Path, State},
|
||||
Json,
|
||||
extract::{Path, State},
|
||||
};
|
||||
use serde_json::json;
|
||||
use sqlx::PgPool;
|
||||
|
||||
@@ -15,14 +15,14 @@ use crate::{
|
||||
use macros::panic_with_log;
|
||||
|
||||
use git2::{Delta, Repository};
|
||||
use sqlx::{Pool, Postgres};
|
||||
use sqlx::{PgPool, Pool, Postgres};
|
||||
use tracing::{error, info, warn, Level};
|
||||
|
||||
mod error;
|
||||
mod index;
|
||||
mod utils;
|
||||
|
||||
pub fn task(db_connection: &Pool<Postgres>) {
|
||||
pub fn task(db_connection: &PgPool) {
|
||||
// init
|
||||
let git_work_dir = {
|
||||
let path = if let Ok(default_log_path) = env::var(var_name::WORK_DIR) {
|
||||
|
||||
@@ -3,6 +3,7 @@ mod cron;
|
||||
|
||||
use crate::{
|
||||
modules::{
|
||||
Module,
|
||||
blog::{
|
||||
api::{
|
||||
get_page_count,
|
||||
@@ -11,12 +12,11 @@ use crate::{
|
||||
},
|
||||
// cron::check_update,
|
||||
},
|
||||
Module,
|
||||
},
|
||||
scheduler::tasks::CronTask,
|
||||
};
|
||||
|
||||
use axum::{routing::get, Router};
|
||||
use axum::{Router, routing::get};
|
||||
use sqlx::PgPool;
|
||||
|
||||
const MOUNT_POINT: &str = "/blog";
|
||||
|
||||
@@ -5,7 +5,7 @@ use std::num::ParseIntError;
|
||||
|
||||
use crate::{
|
||||
constants::config::server::{default_value, var_name},
|
||||
scheduler::{tasks::CronTask, Scheduler},
|
||||
scheduler::{Scheduler, tasks::CronTask},
|
||||
};
|
||||
use macros::error_panic;
|
||||
|
||||
|
||||
Reference in new issue
Block a user