Skip to content

Commit

Permalink
Fixed fmt.
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Kirilin <[email protected]>
  • Loading branch information
s3rius committed Nov 17, 2023
1 parent ebe7f05 commit fb2c390
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 31 deletions.
2 changes: 2 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
use_try_shorthand=true
imports_granularity="Crate"
1 change: 0 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

use clap::Parser;

use crate::{extensions::TusExtensions, info_storages::AvailableInfoStorages};
Expand Down
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ use crate::{config::Config, server::start_server};
pub mod config;
pub mod data_storage;
pub mod errors;
pub mod extensions;
pub mod info_storages;
pub mod models;
pub mod server;
pub mod state;
pub mod utils;
pub mod extensions;

#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;


#[cfg_attr(coverage, no_coverage)]
fn setup_logging(app_config: &Config) -> anyhow::Result<()> {
let colors = ColoredLevelConfig::new()
Expand Down
4 changes: 1 addition & 3 deletions src/models/file_info.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@


use base64::{engine::general_purpose, Engine};
use chrono::{serde::ts_seconds, DateTime, Utc};
use rustc_hash::{FxHashMap};
use rustc_hash::FxHashMap;
use serde::{Deserialize, Serialize};

/// Information about file.
Expand Down
4 changes: 0 additions & 4 deletions src/server/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@




use crate::{config::Config, state::RustusState};

mod routes;
Expand Down
17 changes: 9 additions & 8 deletions src/server/routes/create.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
use axum::http::StatusCode;
use axum::response::{IntoResponse, Response};
use axum::{extract::State, http::HeaderMap};
use axum::{
extract::State,
http::{HeaderMap, StatusCode},
response::{IntoResponse, Response},
};
use bytes::Bytes;

use crate::extensions::TusExtensions;
use crate::info_storages::base::InfoStorage;
use crate::models::file_info::FileInfo;
use crate::utils::headers::HeaderMapExt;
use crate::{errors::RustusResult, state::RustusState};
use crate::{
errors::RustusResult, extensions::TusExtensions, info_storages::base::InfoStorage,
models::file_info::FileInfo, state::RustusState, utils::headers::HeaderMapExt,
};

pub async fn create_route(
State(ref state): State<RustusState>,
Expand Down
6 changes: 1 addition & 5 deletions src/state.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
use crate::{
config::Config,
data_storage::{DataStorageImpl},
info_storages::InfoStorageImpl,
};
use crate::{config::Config, data_storage::DataStorageImpl, info_storages::InfoStorageImpl};

#[derive(Clone)]
pub struct RustusState {
Expand Down
3 changes: 1 addition & 2 deletions src/utils/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ mod tests {
use std::str::FromStr;

use crate::from_str;
use strum::Display;
use strum::EnumIter;
use strum::{Display, EnumIter};

#[derive(PartialEq, Debug, Display, EnumIter, Clone, Eq)]
pub enum TestEnum {
Expand Down
6 changes: 1 addition & 5 deletions src/utils/headers.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
use std::{
collections::HashMap,
hash::{BuildHasherDefault},
str::FromStr,
};
use std::{collections::HashMap, hash::BuildHasherDefault, str::FromStr};

use axum::http::HeaderMap;
use base64::{engine::general_purpose, Engine};
Expand Down
2 changes: 1 addition & 1 deletion src/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pub mod dir_struct;
pub mod enums;
pub mod headers;
pub mod enums;

0 comments on commit fb2c390

Please sign in to comment.