aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/bin/activate.rs3
-rw-r--r--src/bin/deploy.rs2
-rw-r--r--src/deploy.rs8
-rw-r--r--src/lib.rs2
4 files changed, 7 insertions, 8 deletions
diff --git a/src/bin/activate.rs b/src/bin/activate.rs
index 554702c..bf8c907 100644
--- a/src/bin/activate.rs
+++ b/src/bin/activate.rs
@@ -23,7 +23,6 @@ use thiserror::Error;
#[macro_use]
extern crate log;
-#[macro_use]
extern crate serde_derive;
/// Remote activation utility for deploy-rs
@@ -426,7 +425,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Ensure that this process stays alive after the SSH connection dies
let mut signals = Signals::new(&[SIGHUP])?;
std::thread::spawn(move || {
- for sig in signals.forever() {
+ for _ in signals.forever() {
println!("Received NOHUP - ignoring...");
}
});
diff --git a/src/bin/deploy.rs b/src/bin/deploy.rs
index 0381525..4620a1c 100644
--- a/src/bin/deploy.rs
+++ b/src/bin/deploy.rs
@@ -229,7 +229,7 @@ fn print_deployment(
for (data, defs) in parts {
part_map
.entry(data.node_name.to_string())
- .or_insert(HashMap::new())
+ .or_insert_with(HashMap::new)
.insert(
data.profile_name.to_string(),
PromptPart {
diff --git a/src/deploy.rs b/src/deploy.rs
index 3371160..4d13330 100644
--- a/src/deploy.rs
+++ b/src/deploy.rs
@@ -13,7 +13,7 @@ fn build_activate_command(
profile_path: &str,
closure: &str,
auto_rollback: bool,
- temp_path: &Cow<str>,
+ temp_path: &str,
confirm_timeout: u16,
magic_rollback: bool,
debug_logs: bool,
@@ -60,7 +60,7 @@ fn test_activation_command_builder() {
let profile_path = "/blah/profiles/test";
let closure = "/nix/store/blah/etc";
let auto_rollback = true;
- let temp_path = &"/tmp".into();
+ let temp_path = "/tmp";
let confirm_timeout = 30;
let magic_rollback = true;
let debug_logs = true;
@@ -86,7 +86,7 @@ fn test_activation_command_builder() {
fn build_wait_command(
sudo: &Option<String>,
closure: &str,
- temp_path: &Cow<str>,
+ temp_path: &str,
debug_logs: bool,
log_dir: Option<&str>,
) -> String {
@@ -116,7 +116,7 @@ fn build_wait_command(
fn test_wait_command_builder() {
let sudo = Some("sudo -u test".to_string());
let closure = "/nix/store/blah/etc";
- let temp_path = &"/tmp".into();
+ let temp_path = "/tmp";
let debug_logs = true;
let log_dir = Some("/tmp/something.txt");
diff --git a/src/lib.rs b/src/lib.rs
index 21bfb8c..6a6873f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -19,7 +19,7 @@ extern crate serde_derive;
pub fn make_lock_path(temp_path: &str, closure: &str) -> String {
let lock_hash =
- &closure["/nix/store/".len()..closure.find("-").unwrap_or_else(|| closure.len())];
+ &closure["/nix/store/".len()..closure.find('-').unwrap_or_else(|| closure.len())];
format!("{}/deploy-rs-canary-{}", temp_path, lock_hash)
}