vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

commit 84bcac0112af6570563f7f174849f98b23e5284b
parent 31595888ea0ae46eb93e49fc6876bbad368ab9d1
Author: Yip Rui Fung <rf@yrf.me>
Date:   Sat,  9 Jul 2022 10:49:51 +0800

Apply rustfmt.

Because apparently CLion's default formatting is not the same as rustfmt for some reason.

Diffstat:
Msrc/api/core/ciphers.rs | 12++++++------
Msrc/api/core/sends.rs | 7+++----
2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/api/core/ciphers.rs b/src/api/core/ciphers.rs @@ -2,20 +2,20 @@ use std::collections::{HashMap, HashSet}; use chrono::{NaiveDateTime, Utc}; use futures::{stream, stream::StreamExt}; +use rocket::fs::TempFile; +use rocket::serde::json::Json; use rocket::{ form::{Form, FromForm}, Route, }; -use rocket::fs::TempFile; -use rocket::serde::json::Json; use serde_json::Value; use crate::{ api::{self, EmptyResult, JsonResult, JsonUpcase, Notify, PasswordData, UpdateType}, auth::Headers, - CONFIG, crypto, - db::{DbConn, DbPool, models::*}, + db::{models::*, DbConn, DbPool}, + CONFIG, }; use super::folders::FolderData; @@ -805,7 +805,7 @@ async fn share_cipher_by_uuid( nt, UpdateType::CipherUpdate, ) - .await?; + .await?; Ok(Json(cipher.to_json(&headers.host, &headers.user.uuid, None, conn).await)) } @@ -1001,7 +1001,7 @@ async fn save_attachment( match data.data.persist_to(&file_path).await { Ok(_result) => {} - Err(_error) => data.data.move_copy_to(&file_path).await? + Err(_error) => data.data.move_copy_to(&file_path).await?, } nt.send_cipher_update(UpdateType::CipherUpdate, &cipher, &cipher.update_users_revision(&conn).await).await; diff --git a/src/api/core/sends.rs b/src/api/core/sends.rs @@ -10,9 +10,9 @@ use serde_json::Value; use crate::{ api::{ApiResult, EmptyResult, JsonResult, JsonUpcase, Notify, NumberOrString, UpdateType}, auth::{ClientIp, Headers, Host}, - CONFIG, - db::{DbConn, DbPool, models::*}, + db::{models::*, DbConn, DbPool}, util::SafeString, + CONFIG, }; const SEND_INACCESSIBLE_MSG: &str = "Send does not exist or is no longer available"; @@ -226,10 +226,9 @@ async fn post_send_file(data: Form<UploadData<'_>>, headers: Headers, conn: DbCo let file_path = folder_path.join(&file_id); tokio::fs::create_dir_all(&folder_path).await?; - match data.persist_to(&file_path).await { Ok(_result) => {} - Err(_error) => data.move_copy_to(&file_path).await? + Err(_error) => data.move_copy_to(&file_path).await?, } let mut data_value: Value = serde_json::from_str(&send.data)?;