mirror of
				https://github.com/dani-garcia/vaultwarden.git
				synced 2025-10-31 02:08:20 +02:00 
			
		
		
		
	Fixed some lint issues
This commit is contained in:
		| @@ -78,7 +78,7 @@ impl Attachment { | ||||
|                         println!("ERROR: Failed with 10 retries"); | ||||
|                         return Err(err) | ||||
|                     } else { | ||||
|                         retries = retries - 1; | ||||
|                         retries -= 1; | ||||
|                         println!("Had to retry! Retries left: {}", retries); | ||||
|                         thread::sleep(time::Duration::from_millis(500)); | ||||
|                         continue | ||||
|   | ||||
| @@ -362,6 +362,6 @@ impl Cipher { | ||||
|             ) | ||||
|         )) | ||||
|         .select(ciphers_collections::collection_uuid) | ||||
|         .load::<String>(&**conn).unwrap_or(vec![]) | ||||
|         .load::<String>(&**conn).unwrap_or_default() | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -194,7 +194,7 @@ impl UserOrganization { | ||||
|         }) | ||||
|     } | ||||
|  | ||||
|     pub fn to_json_collection_user_details(&self, read_only: &bool, conn: &DbConn) -> JsonValue { | ||||
|     pub fn to_json_collection_user_details(&self, read_only: bool, conn: &DbConn) -> JsonValue { | ||||
|         let user = User::find_by_uuid(&self.user_uuid, conn).unwrap(); | ||||
|  | ||||
|         json!({ | ||||
| @@ -281,14 +281,14 @@ impl UserOrganization { | ||||
|         users_organizations::table | ||||
|             .filter(users_organizations::user_uuid.eq(user_uuid)) | ||||
|             .filter(users_organizations::status.eq(UserOrgStatus::Confirmed as i32)) | ||||
|             .load::<Self>(&**conn).unwrap_or(vec![]) | ||||
|             .load::<Self>(&**conn).unwrap_or_default() | ||||
|     } | ||||
|  | ||||
|     pub fn find_invited_by_user(user_uuid: &str, conn: &DbConn) -> Vec<Self> { | ||||
|         users_organizations::table | ||||
|             .filter(users_organizations::user_uuid.eq(user_uuid)) | ||||
|             .filter(users_organizations::status.eq(UserOrgStatus::Invited as i32)) | ||||
|             .load::<Self>(&**conn).unwrap_or(vec![]) | ||||
|             .load::<Self>(&**conn).unwrap_or_default() | ||||
|     } | ||||
|  | ||||
|     pub fn find_by_org(org_uuid: &str, conn: &DbConn) -> Vec<Self> { | ||||
|   | ||||
| @@ -113,7 +113,7 @@ impl User { | ||||
|         let orgs = UserOrganization::find_by_user(&self.uuid, conn); | ||||
|         let orgs_json: Vec<JsonValue> = orgs.iter().map(|c| c.to_json(&conn)).collect(); | ||||
|  | ||||
|         let twofactor_enabled = TwoFactor::find_by_user(&self.uuid, conn).len() > 0; | ||||
|         let twofactor_enabled = !TwoFactor::find_by_user(&self.uuid, conn).is_empty(); | ||||
|  | ||||
|         json!({ | ||||
|             "Id": self.uuid, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user