Browse Source

Run nightly cargo fmt

merge-requests/14/head
Devin Ragotzy 5 years ago
parent
commit
0d55964d24
  1. 2
      rustfmt.toml
  2. 8
      src/database.rs
  3. 6
      src/database/appservice.rs
  4. 9
      src/database/globals.rs
  5. 3
      src/database/sending.rs
  6. 6
      src/error.rs
  7. 10
      src/main.rs

2
rustfmt.toml

@ -1 +1 @@ @@ -1 +1 @@
merge_imports = true
imports_granularity="Crate"

8
src/database.rs

@ -17,9 +17,11 @@ use log::info; @@ -17,9 +17,11 @@ use log::info;
use rocket::futures::{self, channel::mpsc};
use ruma::{DeviceId, ServerName, UserId};
use serde::Deserialize;
use std::collections::HashMap;
use std::fs::remove_dir_all;
use std::sync::{Arc, RwLock};
use std::{
collections::HashMap,
fs::remove_dir_all,
sync::{Arc, RwLock},
};
use tokio::sync::Semaphore;
#[derive(Clone, Debug, Deserialize)]

6
src/database/appservice.rs

@ -1,6 +1,8 @@ @@ -1,6 +1,8 @@
use crate::{utils, Error, Result};
use std::collections::HashMap;
use std::sync::{Arc, RwLock};
use std::{
collections::HashMap,
sync::{Arc, RwLock},
};
#[derive(Clone)]
pub struct Appservice {

9
src/database/globals.rs

@ -4,10 +4,11 @@ use ruma::{ @@ -4,10 +4,11 @@ use ruma::{
api::federation::discovery::{ServerSigningKeys, VerifyKey},
ServerName, ServerSigningKeyId,
};
use std::collections::{BTreeMap, HashMap};
use std::sync::Arc;
use std::sync::RwLock;
use std::time::Duration;
use std::{
collections::{BTreeMap, HashMap},
sync::{Arc, RwLock},
time::Duration,
};
use trust_dns_resolver::TokioAsyncResolver;
pub const COUNTER: &str = "c";

3
src/database/sending.rs

@ -16,8 +16,7 @@ use ruma::{ @@ -16,8 +16,7 @@ use ruma::{
ServerName,
};
use sled::IVec;
use tokio::select;
use tokio::sync::Semaphore;
use tokio::{select, sync::Semaphore};
#[derive(Clone)]
pub struct Sending {

6
src/error.rs

@ -1,4 +1,8 @@ @@ -1,4 +1,8 @@
use std::{collections::HashMap, sync::RwLock, time::Duration, time::Instant};
use std::{
collections::HashMap,
sync::RwLock,
time::{Duration, Instant},
};
use log::error;
use ruma::{

10
src/main.rs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// #![warn(rust_2018_idioms)]
#![warn(rust_2018_idioms)]
pub mod appservice_server;
pub mod client_server;
@ -19,11 +19,15 @@ pub use rocket::State; @@ -19,11 +19,15 @@ pub use rocket::State;
use ruma::api::client::error::ErrorKind;
pub use ruma_wrapper::{ConduitResult, Ruma, RumaResponse};
use rocket::figment::{
use rocket::{
catch, catchers,
fairing::AdHoc,
figment::{
providers::{Env, Format, Toml},
Figment,
},
routes, Request,
};
use rocket::{catch, catchers, fairing::AdHoc, routes, Request};
use tracing::span;
use tracing_subscriber::{prelude::*, Registry};

Loading…
Cancel
Save