Skip to content

Commit 3309382

Browse files
committed
collapse if
1 parent 34cc894 commit 3309382

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Diff for: src/c/mod.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -528,12 +528,10 @@ pub unsafe extern "C" fn controller_clear(
528528
}
529529

530530
// Save changes if any modifications were made
531-
if modified {
532-
if sessions_storage.write_to_file(account_file).is_err() {
533-
return Result::Err(Error {
534-
message: CString::new("Failed to save updated sessions").unwrap().into_raw(),
535-
});
536-
}
531+
if modified && sessions_storage.write_to_file(account_file).is_err() {
532+
return Result::Err(Error {
533+
message: CString::new("Failed to save updated sessions").unwrap().into_raw(),
534+
});
537535
}
538536

539537
Result::Ok(true)

0 commit comments

Comments
 (0)