From 815814529eec6f739eb1618fdf356e526b3879e1 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Sun, 24 Jan 2021 23:38:44 -0800 Subject: changed: remove 2015-style extern crate --- Cargo.lock | 4 +++- Cargo.toml | 5 ++--- src/bin/activate.rs | 5 +---- src/bin/deploy.rs | 11 +++-------- src/data.rs | 2 +- src/deploy.rs | 4 ++-- src/lib.rs | 6 ------ src/push.rs | 4 ++-- 8 files changed, 14 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8a96a33..ddd4787 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -144,7 +144,6 @@ dependencies = [ "notify", "rnix", "serde", - "serde_derive", "serde_json", "signal-hook", "smol_str", @@ -770,6 +769,9 @@ name = "serde" version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" +dependencies = [ + "serde_derive", +] [[package]] name = "serde_derive" diff --git a/Cargo.toml b/Cargo.toml index dc239e5..2b0e61b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,8 +14,7 @@ edition = "2018" clap = "3.0.0-beta.2" tokio = { version = "0.3.5", features = [ "full" ] } serde_json = "1.0.48" -serde_derive = "1.0.104" -serde = "1.0.104" +serde = { version = "1.0.104", features = [ "derive" ] } merge = "0.1.0" whoami = "0.9.0" log = "0.4" @@ -37,4 +36,4 @@ smol_str = "=0.1.16" [lib] name = "deploy" -path = "src/lib.rs" \ No newline at end of file +path = "src/lib.rs" diff --git a/src/bin/activate.rs b/src/bin/activate.rs index 2f13b44..947e883 100644 --- a/src/bin/activate.rs +++ b/src/bin/activate.rs @@ -20,10 +20,7 @@ use notify::{RecommendedWatcher, RecursiveMode, Watcher}; use thiserror::Error; -#[macro_use] -extern crate log; - -extern crate serde_derive; +use log::{debug, error, info, warn}; /// Remote activation utility for deploy-rs #[derive(Clap, Debug)] diff --git a/src/bin/deploy.rs b/src/bin/deploy.rs index caf3d4e..3ee2ec2 100644 --- a/src/bin/deploy.rs +++ b/src/bin/deploy.rs @@ -7,16 +7,11 @@ use std::io::{stdin, stdout, Write}; use clap::Clap; +use log::{debug, error, info, warn}; +use serde::Serialize; use std::process::Stdio; -use tokio::process::Command; - use thiserror::Error; - -#[macro_use] -extern crate log; - -#[macro_use] -extern crate serde_derive; +use tokio::process::Command; /// Simple Rust rewrite of a simple Nix Flake deployment tool #[derive(Clap, Debug)] diff --git a/src/data.rs b/src/data.rs index f557e41..6fe7f75 100644 --- a/src/data.rs +++ b/src/data.rs @@ -3,7 +3,7 @@ // SPDX-License-Identifier: MPL-2.0 use merge::Merge; - +use serde::Deserialize; use std::collections::HashMap; #[derive(Deserialize, Debug, Clone, Merge)] diff --git a/src/deploy.rs b/src/deploy.rs index a33721c..686c7b7 100644 --- a/src/deploy.rs +++ b/src/deploy.rs @@ -3,10 +3,10 @@ // // SPDX-License-Identifier: MPL-2.0 +use log::{debug, info}; use std::borrow::Cow; -use tokio::process::Command; - use thiserror::Error; +use tokio::process::Command; struct ActivateCommandData<'a> { sudo: &'a Option, diff --git a/src/lib.rs b/src/lib.rs index edc0507..b93b9ae 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,12 +11,6 @@ use thiserror::Error; use flexi_logger::*; -#[macro_use] -extern crate log; - -#[macro_use] -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())]; diff --git a/src/push.rs b/src/push.rs index 2f83019..0963a9a 100644 --- a/src/push.rs +++ b/src/push.rs @@ -2,11 +2,11 @@ // // SPDX-License-Identifier: MPL-2.0 +use log::{debug, info}; use std::path::Path; use std::process::Stdio; -use tokio::process::Command; - use thiserror::Error; +use tokio::process::Command; #[derive(Error, Debug)] pub enum PushProfileError { -- cgit v1.2.3 From 9c32ddeb05421a6795e9509a17d1c5f565ea0d0e Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Sun, 24 Jan 2021 23:39:08 -0800 Subject: changed: sort Cargo.toml --- Cargo.toml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2b0e61b..fce88bd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,21 +12,21 @@ edition = "2018" [dependencies] clap = "3.0.0-beta.2" -tokio = { version = "0.3.5", features = [ "full" ] } -serde_json = "1.0.48" -serde = { version = "1.0.104", features = [ "derive" ] } -merge = "0.1.0" -whoami = "0.9.0" -log = "0.4" flexi_logger = "0.16" -notify = "5.0.0-pre.3" -futures-util = "0.3.6" fork = "0.1" +futures-util = "0.3.6" +log = "0.4" +merge = "0.1.0" +notify = "5.0.0-pre.3" +rnix = "0.8" +serde = { version = "1.0.104", features = [ "derive" ] } +serde_json = "1.0.48" +signal-hook = "0.3" thiserror = "1.0" +tokio = { version = "0.3.5", features = [ "full" ] } toml = "0.5" +whoami = "0.9.0" yn = "0.1" -rnix = "0.8" -signal-hook = "0.3" # smol_str is required by rnix, but 0.1.17 doesn't build on rustc # 1.45.2 (shipped in nixos-20.09); it requires rustc 1.46.0. See -- cgit v1.2.3