mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
lint
This commit is contained in:
@@ -88,7 +88,7 @@ impl BookmarksClient {
|
||||
error!("Failed to set new key into storage: {}", e);
|
||||
return Err(SerializerError::new_ex(
|
||||
SerializerErrorKind::Io,
|
||||
format!("Could not write key to storage: {}", e),
|
||||
format!("Could not write key to storage: {e}"),
|
||||
));
|
||||
}
|
||||
// Return key
|
||||
@@ -98,7 +98,7 @@ impl BookmarksClient {
|
||||
error!("Failed to get key from storage: {}", e);
|
||||
return Err(SerializerError::new_ex(
|
||||
SerializerErrorKind::Io,
|
||||
format!("Could not get key from storage: {}", e),
|
||||
format!("Could not get key from storage: {e}"),
|
||||
));
|
||||
}
|
||||
},
|
||||
|
||||
@@ -249,7 +249,7 @@ impl ConfigClient {
|
||||
// Get key path
|
||||
let ssh_key_path: PathBuf = {
|
||||
let mut p: PathBuf = self.ssh_key_dir.clone();
|
||||
p.push(format!("{}.key", host_name));
|
||||
p.push(format!("{host_name}.key"));
|
||||
p
|
||||
};
|
||||
info!(
|
||||
@@ -390,7 +390,7 @@ impl ConfigClient {
|
||||
/// Hosts are saved as `username@host` into configuration.
|
||||
/// This method creates the key name, starting from host and username
|
||||
fn make_ssh_host_key(host: &str, username: &str) -> String {
|
||||
format!("{}@{}", username, host)
|
||||
format!("{username}@{host}")
|
||||
}
|
||||
|
||||
/// Get ssh tokens starting from ssh host key
|
||||
|
||||
@@ -25,7 +25,7 @@ impl FileStorage {
|
||||
/// Make file path for key file from `dir_path` and the application id
|
||||
fn make_file_path(&self, storage_id: &str) -> PathBuf {
|
||||
let mut p: PathBuf = self.dir_path.clone();
|
||||
let file_name = format!(".{}.key", storage_id);
|
||||
let file_name = format!(".{storage_id}.key");
|
||||
p.push(file_name);
|
||||
p
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ pub fn init(level: LogLevel) -> Result<(), String> {
|
||||
let config = ConfigBuilder::new().set_time_format_rfc3339().build();
|
||||
// Make logger
|
||||
WriteLogger::init(level, config, file)
|
||||
.map_err(|e| format!("Failed to initialize logger: {}", e))
|
||||
.map_err(|e| format!("Failed to initialize logger: {e}"))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -29,7 +29,7 @@ impl SshKeyStorage {
|
||||
|
||||
/// Make mapkey from host and username
|
||||
fn make_mapkey(host: &str, username: &str) -> String {
|
||||
format!("{}@{}", username, host)
|
||||
format!("{username}@{host}")
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -46,11 +46,11 @@ impl SshKeyStorage {
|
||||
use std::io::BufReader;
|
||||
|
||||
let mut reader = File::open(path)
|
||||
.map_err(|e| format!("failed to open {}: {}", path, e))
|
||||
.map_err(|e| format!("failed to open {path}: {e}"))
|
||||
.map(BufReader::new)?;
|
||||
SshConfig::default()
|
||||
.parse(&mut reader)
|
||||
.map_err(|e| format!("Failed to parse ssh2 config: {}", e))
|
||||
.map_err(|e| format!("Failed to parse ssh2 config: {e}"))
|
||||
}
|
||||
|
||||
/// Resolve host via termscp ssh keys storage
|
||||
|
||||
Reference in New Issue
Block a user