Skip to content

Commit

Permalink
fix: [torrust#453] cargo fmt --check for nigthly toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
josecelano committed Feb 6, 2024
1 parent 935facb commit 324fac7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 27 deletions.
6 changes: 3 additions & 3 deletions src/console/commands/seeder/api.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
use log::debug;
use thiserror::Error;

use crate::web::api::client::v1::client::Client;
use crate::web::api::client::v1::contexts::category::forms::AddCategoryForm;
use crate::web::api::client::v1::contexts::category::responses::{ListItem, ListResponse};
Expand All @@ -7,9 +10,6 @@ use crate::web::api::client::v1::contexts::user::forms::LoginForm;
use crate::web::api::client::v1::contexts::user::responses::{LoggedInUserData, SuccessfulLoginResponse};
use crate::web::api::client::v1::responses::TextResponse;

use log::debug;
use thiserror::Error;

#[derive(Error, Debug)]
pub enum Error {
#[error("Torrent with the same info-hash already exist in the database")]
Expand Down
30 changes: 10 additions & 20 deletions src/console/commands/seeder/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,24 @@
//!
//! That command would upload 1000 random torrents to the Index using the user
//! account admin with password 123456 and waiting 1 second between uploads.
use std::{thread::sleep, time::Duration};
use std::thread::sleep;
use std::time::Duration;

use anyhow::Context;
use clap::Parser;
use log::{debug, info, LevelFilter};
use text_colorizer::Colorize;
use uuid::Uuid;

use crate::{
console::commands::seeder::{
api::{login, upload_torrent},
logging,
},
services::torrent_file::generate_random_torrent,
utils::parse_torrent,
web::api::client::v1::{
client::Client,
contexts::{
torrent::{
forms::{BinaryFile, UploadTorrentMultipartForm},
responses::UploadedTorrent,
},
user::responses::LoggedInUserData,
},
},
};

use super::api::Error;
use crate::console::commands::seeder::api::{login, upload_torrent};
use crate::console::commands::seeder::logging;
use crate::services::torrent_file::generate_random_torrent;
use crate::utils::parse_torrent;
use crate::web::api::client::v1::client::Client;
use crate::web::api::client::v1::contexts::torrent::forms::{BinaryFile, UploadTorrentMultipartForm};
use crate::web::api::client::v1::contexts::torrent::responses::UploadedTorrent;
use crate::web::api::client::v1::contexts::user::responses::LoggedInUserData;

#[derive(Parser, Debug)]
#[clap(author, version, about, long_about = None)]
Expand Down
4 changes: 2 additions & 2 deletions src/console/commands/seeder/logging.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use log::{debug, LevelFilter};

/// # Panics
///
///
///
///
pub fn setup(level: LevelFilter) {
if let Err(_err) = fern::Dispatch::new()
.format(|out, message, record| {
Expand Down
3 changes: 2 additions & 1 deletion src/web/api/client/v1/contexts/settings/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
pub mod responses;

use serde::{Deserialize, Serialize};

use crate::config::{
Api as DomainApi, Auth as DomainAuth, Database as DomainDatabase, ImageCache as DomainImageCache, Mail as DomainMail,
Network as DomainNetwork, TorrustIndex as DomainSettings, Tracker as DomainTracker,
TrackerStatisticsImporter as DomainTrackerStatisticsImporter, Website as DomainWebsite,
};
use serde::{Deserialize, Serialize};

#[derive(Deserialize, Serialize, PartialEq, Debug, Clone)]
pub struct Settings {
Expand Down
2 changes: 1 addition & 1 deletion src/web/api/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use std::sync::Arc;
use futures::Future;
use log::info;
use tokio::sync::oneshot::{self, Sender};
use v1::routes::router;

use super::{Running, ServerStartedMessage};
use crate::common::AppData;
use v1::routes::router;

/// Starts the API server.
///
Expand Down

0 comments on commit 324fac7

Please sign in to comment.