mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
clippy
This commit is contained in:
committed by
Christian Visintin
parent
babbc5eadb
commit
697ab225ea
@@ -85,8 +85,7 @@ impl FileTransferActivity {
|
|||||||
SelectedFileIndex::Many(files) => {
|
SelectedFileIndex::Many(files) => {
|
||||||
let files: Vec<&File> = files
|
let files: Vec<&File> = files
|
||||||
.iter()
|
.iter()
|
||||||
.map(|x| self.local().get(*x)) // Usize to Option<File>
|
.filter_map(|x| self.local().get(*x)) // Usize to Option<File>
|
||||||
.flatten()
|
|
||||||
.collect();
|
.collect();
|
||||||
SelectedFile::from(files)
|
SelectedFile::from(files)
|
||||||
}
|
}
|
||||||
@@ -101,8 +100,7 @@ impl FileTransferActivity {
|
|||||||
SelectedFileIndex::Many(files) => {
|
SelectedFileIndex::Many(files) => {
|
||||||
let files: Vec<&File> = files
|
let files: Vec<&File> = files
|
||||||
.iter()
|
.iter()
|
||||||
.map(|x| self.remote().get(*x)) // Usize to Option<File>
|
.filter_map(|x| self.remote().get(*x)) // Usize to Option<File>
|
||||||
.flatten()
|
|
||||||
.collect();
|
.collect();
|
||||||
SelectedFile::from(files)
|
SelectedFile::from(files)
|
||||||
}
|
}
|
||||||
@@ -129,8 +127,7 @@ impl FileTransferActivity {
|
|||||||
SelectedFileIndex::Many(files) => {
|
SelectedFileIndex::Many(files) => {
|
||||||
let files: Vec<&File> = files
|
let files: Vec<&File> = files
|
||||||
.iter()
|
.iter()
|
||||||
.map(|x| self.found().as_ref().unwrap().get(*x)) // Usize to Option<File>
|
.filter_map(|x| self.found().as_ref().unwrap().get(*x)) // Usize to Option<File>
|
||||||
.flatten()
|
|
||||||
.collect();
|
.collect();
|
||||||
SelectedFile::from(files)
|
SelectedFile::from(files)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,16 +32,16 @@ use magic_crypt::MagicCryptTrait;
|
|||||||
///
|
///
|
||||||
/// Crypt a string using AES128; output is returned as a BASE64 string
|
/// Crypt a string using AES128; output is returned as a BASE64 string
|
||||||
pub fn aes128_b64_crypt(key: &str, input: &str) -> String {
|
pub fn aes128_b64_crypt(key: &str, input: &str) -> String {
|
||||||
let crypter = new_magic_crypt!(key.to_string(), 128);
|
let crypter = new_magic_crypt!(key, 128);
|
||||||
crypter.encrypt_str_to_base64(input.to_string())
|
crypter.encrypt_str_to_base64(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ### aes128_b64_decrypt
|
/// ### aes128_b64_decrypt
|
||||||
///
|
///
|
||||||
/// Decrypt a string using AES128
|
/// Decrypt a string using AES128
|
||||||
pub fn aes128_b64_decrypt(key: &str, secret: &str) -> Result<String, magic_crypt::MagicCryptError> {
|
pub fn aes128_b64_decrypt(key: &str, secret: &str) -> Result<String, magic_crypt::MagicCryptError> {
|
||||||
let crypter = new_magic_crypt!(key.to_string(), 128);
|
let crypter = new_magic_crypt!(key, 128);
|
||||||
crypter.decrypt_base64_to_string(secret.to_string())
|
crypter.decrypt_base64_to_string(secret)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
Reference in New Issue
Block a user