Fix a bunch of warnings
This commit is contained in:
parent
43399c28b1
commit
b9b211723e
@ -1,5 +1,5 @@
|
||||
use crate::entity::{client, project, time_entry};
|
||||
use crate::toggl_api::types::{Project, ProjectClient, ReportEntry, TimeEntry};
|
||||
use crate::toggl_api::types::{Project, ProjectClient, ReportEntry};
|
||||
use sea_orm::sea_query::OnConflict;
|
||||
use sea_orm::{NotSet, Set};
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2
|
||||
#![allow(unused_imports)]
|
||||
|
||||
pub use super::client::Entity as Client;
|
||||
pub use super::project::Entity as Project;
|
||||
|
||||
18
src/main.rs
18
src/main.rs
@ -1,27 +1,11 @@
|
||||
use crate::toggl_api::TogglApiClient;
|
||||
use crate::entity::prelude::TimeEntry;
|
||||
use crate::entity::time_entry;
|
||||
use crate::entity::time_entry::ActiveModel;
|
||||
use crate::toggl_api::types::{Current, Project, ProjectClient, ReportEntry, TogglQuery};
|
||||
use anyhow::anyhow;
|
||||
use axum::extract::multipart::Field;
|
||||
use axum::extract::{Multipart, Query};
|
||||
use axum::http::StatusCode;
|
||||
use axum::response::IntoResponse;
|
||||
use axum::routing::{get, post};
|
||||
use axum::{Extension, Json, Router};
|
||||
use axum::{Extension, Router};
|
||||
use utils::{Result, shutdown_signal};
|
||||
use chrono::{NaiveDate, NaiveTime};
|
||||
use clap::Parser;
|
||||
use migration::{Migrator, MigratorTrait};
|
||||
use sea_orm::sea_query::IntoCondition;
|
||||
use sea_orm::{ColumnTrait, Condition, DatabaseConnection, EntityTrait, QueryFilter};
|
||||
use serde::Deserialize;
|
||||
use serde_json::Value;
|
||||
use std::collections::HashMap;
|
||||
use std::net::SocketAddr;
|
||||
use tower_http::trace::TraceLayer;
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
mod db;
|
||||
mod entity;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
use crate::toggl_api::TogglApiClient;
|
||||
use crate::entity::{client, project, time_entry};
|
||||
use crate::entity::{client, project};
|
||||
use crate::toggl_api::types::{Project, ProjectClient, TogglQuery};
|
||||
use sea_orm::{DatabaseConnection, EntityTrait, QuerySelect};
|
||||
use tracing::instrument;
|
||||
|
||||
@ -7,10 +7,10 @@ use axum::http::StatusCode;
|
||||
use sea_orm::{ColumnTrait, DatabaseConnection, EntityTrait, QueryFilter};
|
||||
use anyhow::anyhow;
|
||||
use axum::extract::{Multipart, Query};
|
||||
use migration::{Condition, IntoCondition};
|
||||
use chrono::{NaiveDate, NaiveTime};
|
||||
use migration::{Condition};
|
||||
use chrono::{NaiveDate};
|
||||
use serde::Deserialize;
|
||||
use crate::entity::time_entry::{ActiveModel, Entity as TimeEntry};
|
||||
use crate::entity::time_entry::{Entity as TimeEntry};
|
||||
use crate::toggl_api::TogglApiClient;
|
||||
use crate::toggl_api::types::{Current, Project, ProjectClient, ReportEntry, TogglQuery};
|
||||
use crate::{entity, utils};
|
||||
@ -146,7 +146,7 @@ pub async fn import_csv(
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
struct RefreshQuery {
|
||||
pub struct RefreshQuery {
|
||||
start_date: Option<String>,
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,6 @@ use std::time::Duration;
|
||||
use base64::Engine;
|
||||
use base64::engine::general_purpose::STANDARD;
|
||||
use hyper::HeaderMap;
|
||||
use migration::cli::Cli;
|
||||
use tracing::instrument;
|
||||
use tracing::log::debug;
|
||||
use crate::toggl_api::types::{Current, Project, ProjectClient, ReportEntry, TogglQuery};
|
||||
|
||||
@ -79,7 +79,6 @@ pub struct ProjectClient {
|
||||
pub wid: i32,
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[skip_serializing_none]
|
||||
#[derive(Serialize, Deserialize, Clone, Default)]
|
||||
pub struct TogglQuery {
|
||||
@ -97,11 +96,13 @@ pub struct TogglQuery {
|
||||
pub min_duration_seconds: Option<u64>,
|
||||
pub order_by: Option<String>,
|
||||
pub order_dir: Option<String>,
|
||||
pub postedFields: Option<Vec<String>>,
|
||||
#[serde(rename = "postedFields")]
|
||||
pub posted_fields: Option<Vec<String>>,
|
||||
pub project_ids: Option<Vec<u64>>,
|
||||
pub rounding: Option<u64>,
|
||||
pub rounding_minutes: Option<u64>,
|
||||
pub startTime: Option<String>,
|
||||
#[serde(rename = "startTime")]
|
||||
pub start_time: Option<String>,
|
||||
pub start_date: Option<String>,
|
||||
pub tag_ids: Option<Vec<u64>>,
|
||||
pub task_ids: Option<Vec<u64>>,
|
||||
@ -160,8 +161,8 @@ impl fmt::Debug for TogglQuery {
|
||||
if let Some(order_dir) = &self.order_dir {
|
||||
ds.field("order_dir", order_dir);
|
||||
}
|
||||
if let Some(postedFields) = &self.postedFields {
|
||||
ds.field("postedFields", postedFields);
|
||||
if let Some(posted_fields) = &self.posted_fields {
|
||||
ds.field("postedFields", posted_fields);
|
||||
}
|
||||
if let Some(project_ids) = &self.project_ids {
|
||||
ds.field("project_ids", project_ids);
|
||||
@ -172,8 +173,8 @@ impl fmt::Debug for TogglQuery {
|
||||
if let Some(rounding_minutes) = &self.rounding_minutes {
|
||||
ds.field("rounding_minutes", rounding_minutes);
|
||||
}
|
||||
if let Some(startTime) = &self.startTime {
|
||||
ds.field("startTime", startTime);
|
||||
if let Some(start_time) = &self.start_time {
|
||||
ds.field("startTime", start_time);
|
||||
}
|
||||
if let Some(start_date) = &self.start_date {
|
||||
ds.field("start_date", start_date);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user