mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-06-01 00:13:56 +00:00
Updated dependencies, removed some unnecessary clones and fixed some lints
This commit is contained in:
parent
bf6ae91a6d
commit
5ee04e31e5
7 changed files with 66 additions and 87 deletions
|
@ -608,7 +608,7 @@ fn share_cipher_by_uuid(
|
|||
None => err!("Invalid collection ID provided"),
|
||||
Some(collection) => {
|
||||
if collection.is_writable_by_user(&headers.user.uuid, &conn) {
|
||||
CollectionCipher::save(&cipher.uuid.clone(), &collection.uuid, &conn)?;
|
||||
CollectionCipher::save(&cipher.uuid, &collection.uuid, &conn)?;
|
||||
shared_to_collection = true;
|
||||
} else {
|
||||
err!("No rights to modify the collection")
|
||||
|
|
|
@ -407,7 +407,7 @@ fn _create_u2f_challenge(user_uuid: &str, type_: TwoFactorType, conn: &DbConn) -
|
|||
challenge
|
||||
}
|
||||
|
||||
fn save_u2f_registrations(user_uuid: &str, regs: &Vec<U2FRegistration>, conn: &DbConn) -> EmptyResult {
|
||||
fn save_u2f_registrations(user_uuid: &str, regs: &[U2FRegistration], conn: &DbConn) -> EmptyResult {
|
||||
TwoFactor::new(user_uuid.into(), TwoFactorType::U2f, serde_json::to_string(regs)?).save(&conn)
|
||||
}
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ fn _password_login(data: ConnectData, conn: DbConn, ip: ClientIp) -> JsonResult
|
|||
None => Device::new(device_id, user.uuid.clone(), device_name, device_type),
|
||||
};
|
||||
|
||||
let twofactor_token = twofactor_auth(&user.uuid, &data.clone(), &mut device, &conn)?;
|
||||
let twofactor_token = twofactor_auth(&user.uuid, &data, &mut device, &conn)?;
|
||||
|
||||
// Common
|
||||
let user = User::find_by_uuid(&device.user_uuid, &conn).unwrap();
|
||||
|
|
|
@ -88,7 +88,7 @@ fn serialize(val: Value) -> Vec<u8> {
|
|||
|
||||
fn serialize_date(date: NaiveDateTime) -> Value {
|
||||
let seconds: i64 = date.timestamp();
|
||||
let nanos: i64 = date.timestamp_subsec_nanos() as i64;
|
||||
let nanos: i64 = date.timestamp_subsec_nanos().into();
|
||||
let timestamp = nanos << 34 | seconds;
|
||||
|
||||
let bs = timestamp.to_be_bytes();
|
||||
|
@ -249,7 +249,7 @@ impl WebSocketUsers {
|
|||
ut,
|
||||
);
|
||||
|
||||
self.send_update(&user.uuid.clone(), &data).ok();
|
||||
self.send_update(&user.uuid, &data).ok();
|
||||
}
|
||||
|
||||
pub fn send_folder_update(&self, ut: UpdateType, folder: &Folder) {
|
||||
|
|
|
@ -101,7 +101,7 @@ pub fn delete_file(path: &str) -> IOResult<()> {
|
|||
const UNITS: [&str; 6] = ["bytes", "KB", "MB", "GB", "TB", "PB"];
|
||||
|
||||
pub fn get_display_size(size: i32) -> String {
|
||||
let mut size = size as f64;
|
||||
let mut size: f64 = size.into();
|
||||
let mut unit_counter = 0;
|
||||
|
||||
loop {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue