mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-10-10 22:38:44 +02:00
chore: edition 2024
This commit is contained in:
100 files changed
+276
-253
No files matched your search
@@ -45,8 +45,8 @@ fn create_or_get_salt(salt: &mut [u8], salt_path: &Path) {
|
||||
salt.clone_from_slice(&tmp);
|
||||
} else {
|
||||
// Generate new salt
|
||||
let mut gen = ChaCha20Rng::from_os_rng();
|
||||
gen.fill_bytes(salt);
|
||||
let mut rng = ChaCha20Rng::from_os_rng();
|
||||
rng.fill_bytes(salt);
|
||||
std::fs::write(salt_path, salt).expect("Failed to write salt for Stronghold")
|
||||
}
|
||||
}
|
||||
@@ -23,18 +23,18 @@ use std::{
|
||||
|
||||
use crypto::keys::bip39;
|
||||
use iota_stronghold::{
|
||||
Client, Location,
|
||||
procedures::{
|
||||
BIP39Generate, BIP39Recover, Curve, Ed25519Sign, KeyType as StrongholdKeyType,
|
||||
MnemonicLanguage, PublicKey, Slip10Derive, Slip10DeriveInput, Slip10Generate,
|
||||
StrongholdProcedure,
|
||||
},
|
||||
Client, Location,
|
||||
};
|
||||
use serde::{de::Visitor, Deserialize, Deserializer};
|
||||
use serde::{Deserialize, Deserializer, de::Visitor};
|
||||
use stronghold::{Error, Result, Stronghold};
|
||||
use tauri::{
|
||||
plugin::{Builder as PluginBuilder, TauriPlugin},
|
||||
Manager, Runtime, State,
|
||||
plugin::{Builder as PluginBuilder, TauriPlugin},
|
||||
};
|
||||
use zeroize::{Zeroize, Zeroizing};
|
||||
|
||||
@@ -270,12 +270,11 @@ async fn destroy(
|
||||
snapshot_path: PathBuf,
|
||||
) -> Result<()> {
|
||||
let mut collection = collection.0.lock().unwrap();
|
||||
if let Some(stronghold) = collection.remove(&snapshot_path) {
|
||||
if let Err(e) = stronghold.save() {
|
||||
if let Some(stronghold) = collection.remove(&snapshot_path)
|
||||
&& let Err(e) = stronghold.save() {
|
||||
collection.insert(snapshot_path, stronghold);
|
||||
return Err(e);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user