feat(backend) cargo fmt & migration to rust 2024

This commit is contained in:
lumither committed 2025-02-23 17:39:36 -08:00
1 parent ca86dd236e
commit 0c6325d5f2
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) {
+2 -2
View File
@@ -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";
+1 -1
View File
@@ -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;