Fix cargo clippy issues
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -155,12 +155,11 @@ pub async fn sync_device(body: web::Json<JWTRequest>, actor: WebEnergyActor) ->
|
||||
let mut available_update = None;
|
||||
|
||||
// Check if the version is available
|
||||
if let Some(desired) = device.desired_version {
|
||||
if claims.info.version < desired
|
||||
&& ota_manager::update_exists(OTAPlatform::from_str(&claims.info.reference)?, &desired)?
|
||||
{
|
||||
available_update = Some(desired);
|
||||
}
|
||||
if let Some(desired) = device.desired_version
|
||||
&& claims.info.version < desired
|
||||
&& ota_manager::update_exists(OTAPlatform::from_str(&claims.info.reference)?, &desired)?
|
||||
{
|
||||
available_update = Some(desired);
|
||||
}
|
||||
|
||||
Ok(HttpResponse::Ok().json(SyncResult {
|
||||
|
@@ -123,17 +123,17 @@ pub async fn set_desired_version(
|
||||
|
||||
for d in devices {
|
||||
// Filter per platform
|
||||
if let Some(p) = body.platform {
|
||||
if d.info.reference != p.to_string() {
|
||||
continue;
|
||||
}
|
||||
if let Some(p) = body.platform
|
||||
&& d.info.reference != p.to_string()
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Filter per device
|
||||
if let Some(ids) = &body.devices {
|
||||
if !ids.contains(&d.id) {
|
||||
continue;
|
||||
}
|
||||
if let Some(ids) = &body.devices
|
||||
&& !ids.contains(&d.id)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
actor
|
||||
|
Reference in New Issue
Block a user