From ed1e8162d56651bb368ecd88d22ca5d926bf7865 Mon Sep 17 00:00:00 2001 From: Levente Kurusa Date: Sun, 23 Dec 2018 16:57:41 +0100 Subject: [PATCH] rust2018: remove `extern crate` Signed-off-by: Levente Kurusa --- src/devices.rs | 2 ++ src/hierarchies.rs | 2 ++ src/lib.rs | 3 +-- tests/builder.rs | 1 - tests/cgroup.rs | 4 ---- tests/cpuset.rs | 2 -- tests/devices.rs | 1 - tests/pids.rs | 3 --- tests/resources.rs | 2 -- 9 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/devices.rs b/src/devices.rs index cee0157..90c386d 100644 --- a/src/devices.rs +++ b/src/devices.rs @@ -5,6 +5,8 @@ use std::io::{Read, Write}; use std::path::PathBuf; +use log::*; + use crate::error::*; use crate::error::ErrorKind::*; diff --git a/src/hierarchies.rs b/src/hierarchies.rs index 920211f..368251a 100644 --- a/src/hierarchies.rs +++ b/src/hierarchies.rs @@ -8,6 +8,8 @@ use std::io::BufRead; use std::io::BufReader; use std::path::{Path, PathBuf}; +use log::*; + use crate::blkio::BlkIoController; use crate::cpu::CpuController; use crate::cpuacct::CpuAcctController; diff --git a/src/lib.rs b/src/lib.rs index 27419ce..e6ed645 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,4 @@ -#[macro_use] -extern crate log; +use log::*; use std::fs::File; use std::io::{BufRead, BufReader, Write}; diff --git a/tests/builder.rs b/tests/builder.rs index 691f535..45c1112 100644 --- a/tests/builder.rs +++ b/tests/builder.rs @@ -1,5 +1,4 @@ //! Some simple tests covering the builder pattern for control groups. -extern crate cgroups; use cgroups::*; use cgroups::cpu::*; use cgroups::devices::*; diff --git a/tests/cgroup.rs b/tests/cgroup.rs index c11caa9..8b15d9a 100644 --- a/tests/cgroup.rs +++ b/tests/cgroup.rs @@ -1,10 +1,6 @@ //! Simple unit tests about the control groups system. -extern crate cgroups; use cgroups::{Cgroup, CgroupPid}; -extern crate libc; -extern crate nix; - #[test] fn test_tasks_iterator() { let hier = cgroups::hierarchies::V1::new(); diff --git a/tests/cpuset.rs b/tests/cpuset.rs index 79eaf5b..c7a8fb0 100644 --- a/tests/cpuset.rs +++ b/tests/cpuset.rs @@ -1,5 +1,3 @@ -extern crate cgroups; - use cgroups::cpuset::CpuSetController; use cgroups::error::ErrorKind; use cgroups::Cgroup; diff --git a/tests/devices.rs b/tests/devices.rs index 7e43a17..2fbb305 100644 --- a/tests/devices.rs +++ b/tests/devices.rs @@ -1,6 +1,5 @@ //! Integration tests about the devices subsystem -extern crate cgroups; use cgroups::devices::{DevicePermissions, DeviceType, DevicesController}; use cgroups::{Cgroup, DeviceResource}; diff --git a/tests/pids.rs b/tests/pids.rs index 248bb34..4c91e54 100644 --- a/tests/pids.rs +++ b/tests/pids.rs @@ -1,14 +1,11 @@ //! Integration tests about the pids subsystem -extern crate cgroups; use cgroups::pid::{PidController, PidMax}; use cgroups::Controller; use cgroups::{Cgroup, CgroupPid, PidResources, Resources}; -extern crate nix; use nix::sys::wait::{waitpid, WaitStatus}; use nix::unistd::{fork, ForkResult, Pid}; -extern crate libc; use libc::pid_t; use std::thread; diff --git a/tests/resources.rs b/tests/resources.rs index 342b541..c612df1 100644 --- a/tests/resources.rs +++ b/tests/resources.rs @@ -1,6 +1,4 @@ //! Integration test about setting resources using `apply()` -extern crate cgroups; - use cgroups::pid::{PidController, PidMax}; use cgroups::{Cgroup, PidResources, Resources};