mirror of
https://codeberg.org/Mo8it/git-webhook-client
synced 2024-11-22 11:08:04 +00:00
Refactor imports
This commit is contained in:
parent
05bd6576a9
commit
89789c196b
6 changed files with 32 additions and 25 deletions
|
@ -1,8 +1,6 @@
|
|||
use anyhow::{Context, Result};
|
||||
use serde::Deserialize;
|
||||
use std::env;
|
||||
use std::fs::File;
|
||||
use std::io::BufReader;
|
||||
use std::{env, fs::File, io::BufReader};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct SocketAddress {
|
||||
|
|
|
@ -7,9 +7,11 @@ use diesel::{
|
|||
use std::env;
|
||||
use tracing::error;
|
||||
|
||||
use crate::config::Hook;
|
||||
use crate::models::{HookLog, NewHookLog};
|
||||
use crate::schema::hooklog;
|
||||
use crate::{
|
||||
config::Hook,
|
||||
models::{HookLog, NewHookLog},
|
||||
schema::hooklog,
|
||||
};
|
||||
|
||||
type DBConnectionManager = ConnectionManager<SqliteConnection>;
|
||||
pub type DBPool = Pool<DBConnectionManager>;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
use axum::http::StatusCode;
|
||||
use axum::response::{IntoResponse, Response};
|
||||
use axum::{
|
||||
http::StatusCode,
|
||||
response::{IntoResponse, Response},
|
||||
};
|
||||
use tracing::error;
|
||||
|
||||
pub struct AppError(anyhow::Error);
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
use anyhow::{Context, Result};
|
||||
use lettre::address::Address;
|
||||
use lettre::message::{Mailbox, MessageBuilder};
|
||||
use lettre::transport::smtp::authentication::Credentials;
|
||||
use lettre::Transport;
|
||||
use lettre::{Message, SmtpTransport};
|
||||
use lettre::{
|
||||
address::Address,
|
||||
message::{Mailbox, Message, MessageBuilder},
|
||||
transport::{smtp::authentication::Credentials, Transport},
|
||||
SmtpTransport,
|
||||
};
|
||||
use std::mem;
|
||||
|
||||
use crate::config;
|
||||
|
|
16
src/main.rs
16
src/main.rs
|
@ -10,11 +10,15 @@ mod states;
|
|||
mod templates;
|
||||
|
||||
use anyhow::Result;
|
||||
use axum::routing::{get, post};
|
||||
use axum::{Router, Server};
|
||||
use axum::{
|
||||
routing::{get, post},
|
||||
Router, Server,
|
||||
};
|
||||
use axum_extra::routing::SpaRouter;
|
||||
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
|
||||
use std::process;
|
||||
use std::{
|
||||
net::{IpAddr, Ipv4Addr, SocketAddr},
|
||||
process,
|
||||
};
|
||||
use tracing::info;
|
||||
|
||||
async fn init() -> Result<()> {
|
||||
|
@ -54,8 +58,8 @@ async fn init() -> Result<()> {
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
init().await.unwrap_or_else(|e| {
|
||||
if let Err(e) = init().await {
|
||||
eprintln!("{e:?}");
|
||||
process::exit(1);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
use anyhow::Context;
|
||||
use askama_axum::IntoResponse;
|
||||
use axum::extract::{Query, State};
|
||||
use axum::http::header::HeaderMap;
|
||||
use axum::response::Response;
|
||||
use axum::{
|
||||
extract::{Query, State},
|
||||
http::header::HeaderMap,
|
||||
response::Response,
|
||||
};
|
||||
use bytes::Bytes;
|
||||
use hmac::{Hmac, Mac};
|
||||
use serde::Deserialize;
|
||||
use serde_json::Value;
|
||||
use sha2::Sha256;
|
||||
use std::process::Command;
|
||||
use std::sync::Arc;
|
||||
use std::thread;
|
||||
use std::{process::Command, sync::Arc, thread};
|
||||
use tracing::{error, info};
|
||||
|
||||
use crate::{db, errors, mailer, states, templates};
|
||||
|
|
Loading…
Reference in a new issue