Skip to content

Commit 01a3c22

Browse files
committed
Transition to Rust 2018
Signed-off-by: Levente Kurusa <[email protected]>
1 parent b5e0706 commit 01a3c22

File tree

18 files changed

+97
-97
lines changed

18 files changed

+97
-97
lines changed

src/blkio.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ use std::fs::File;
66
use std::io::{Read, Write};
77
use std::path::PathBuf;
88

9-
use error::*;
10-
use error::ErrorKind::*;
9+
use crate::error::*;
10+
use crate::error::ErrorKind::*;
1111

12-
use {
12+
use crate::{
1313
BlkIoResources, ControllIdentifier, ControllerInternal, Controllers, Resources, Subsystem,
1414
};
1515

@@ -48,7 +48,7 @@ pub struct IoService {
4848
/// How many items were synchronously transferred.
4949
pub sync: u64,
5050
/// How many items were asynchronously transferred.
51-
pub async: u64,
51+
pub r#async: u64,
5252
/// Total number of items transferred.
5353
pub total: u64,
5454
}
@@ -77,7 +77,7 @@ fn parse_io_service(s: String) -> Result<Vec<IoService>> {
7777
read: read_val.parse::<u64>().unwrap(),
7878
write: write_val.parse::<u64>().unwrap(),
7979
sync: sync_val.parse::<u64>().unwrap(),
80-
async: async_val.parse::<u64>().unwrap(),
80+
r#async: async_val.parse::<u64>().unwrap(),
8181
total: total_val.parse::<u64>().unwrap(),
8282
}),
8383
_ => None,
@@ -695,9 +695,9 @@ impl BlkIoController {
695695

696696
#[cfg(test)]
697697
mod test {
698-
use blkio::{parse_blkio_data, BlkIoData};
699-
use blkio::{parse_io_service, parse_io_service_total, IoService};
700-
use error::*;
698+
use crate::blkio::{parse_blkio_data, BlkIoData};
699+
use crate::blkio::{parse_io_service, parse_io_service_total, IoService};
700+
use crate::error::*;
701701

702702
static TEST_VALUE: &str = "\
703703
8:32 Read 4280320
@@ -773,7 +773,7 @@ Total 61823067136
773773
read: 4280320,
774774
write: 0,
775775
sync: 4280320,
776-
async: 0,
776+
r#async: 0,
777777
total: 4280320,
778778
},
779779
IoService {
@@ -782,7 +782,7 @@ Total 61823067136
782782
read: 5705479168,
783783
write: 56096055296,
784784
sync: 11213923328,
785-
async: 50587611136,
785+
r#async: 50587611136,
786786
total: 61801534464,
787787
},
788788
IoService {
@@ -791,7 +791,7 @@ Total 61823067136
791791
read: 10059776,
792792
write: 0,
793793
sync: 10059776,
794-
async: 0,
794+
r#async: 0,
795795
total: 10059776,
796796
},
797797
IoService {
@@ -800,7 +800,7 @@ Total 61823067136
800800
read: 7192576,
801801
write: 0,
802802
sync: 7192576,
803-
async: 0,
803+
r#async: 0,
804804
total: 7192576,
805805
}
806806
]

src/cgroup.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! This module handles cgroup operations. Start here!
22
3-
use error::*;
3+
use crate::error::*;
44

5-
use {CgroupPid, ControllIdentifier, Controller, Hierarchy, Resources, Subsystem};
5+
use crate::{CgroupPid, ControllIdentifier, Controller, Hierarchy, Resources, Subsystem};
66

77
use std::convert::From;
88
use std::path::Path;

src/cgroup_builder.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
//! .done()
5454
//! .build();
5555
//! ```
56-
use error::*;
56+
use crate::error::*;
5757

58-
use {pid, BlkIoDeviceResource, BlkIoDeviceThrottleResource, Cgroup, DeviceResource, Hierarchy, HugePageResource, NetworkPriority, Resources};
58+
use crate::{pid, BlkIoDeviceResource, BlkIoDeviceThrottleResource, Cgroup, DeviceResource, Hierarchy, HugePageResource, NetworkPriority, Resources};
5959

6060
macro_rules! gen_setter {
6161
($res:ident, $cont:ident, $func:ident, $name:ident, $ty:ty) => {
@@ -215,9 +215,9 @@ impl<'a> DeviceResourceBuilder<'a> {
215215
pub fn device(mut self,
216216
major: i64,
217217
minor: i64,
218-
devtype: ::devices::DeviceType,
218+
devtype: crate::devices::DeviceType,
219219
allow: bool,
220-
access: Vec<::devices::DevicePermissions>)
220+
access: Vec<crate::devices::DevicePermissions>)
221221
-> DeviceResourceBuilder<'a> {
222222
self.cgroup.resources.devices.update_values = true;
223223
self.cgroup.resources.devices.devices.push(DeviceResource {

src/cpu.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ use std::fs::File;
77
use std::io::{Read, Write};
88
use std::path::PathBuf;
99

10-
use error::*;
11-
use error::ErrorKind::*;
10+
use crate::error::*;
11+
use crate::error::ErrorKind::*;
1212

13-
use {
13+
use crate::{
1414
ControllIdentifier, ControllerInternal, Controllers, CpuResources, Resources, Subsystem,
1515
};
1616

src/cpuacct.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ use std::fs::File;
66
use std::io::{Read, Write};
77
use std::path::PathBuf;
88

9-
use error::*;
10-
use error::ErrorKind::*;
9+
use crate::error::*;
10+
use crate::error::ErrorKind::*;
1111

12-
use {ControllIdentifier, ControllerInternal, Controllers, Resources, Subsystem};
12+
use crate::{ControllIdentifier, ControllerInternal, Controllers, Resources, Subsystem};
1313

1414
/// A controller that allows controlling the `cpuacct` subsystem of a Cgroup.
1515
///

src/cpuset.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ use std::fs::File;
66
use std::io::{Read, Write};
77
use std::path::PathBuf;
88

9-
use error::*;
10-
use error::ErrorKind::*;
9+
use crate::error::*;
10+
use crate::error::ErrorKind::*;
1111

12-
use {
12+
use crate::{
1313
ControllIdentifier, ControllerInternal, Controllers, CpuResources, Resources, Subsystem,
1414
};
1515

@@ -427,7 +427,7 @@ impl CpuSetController {
427427

428428
#[cfg(test)]
429429
mod tests {
430-
use cpuset;
430+
use crate::cpuset;
431431
#[test]
432432
fn test_parse_range() {
433433
let test_cases = vec![

src/devices.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
use std::io::{Read, Write};
66
use std::path::PathBuf;
77

8-
use error::*;
9-
use error::ErrorKind::*;
8+
use crate::error::*;
9+
use crate::error::ErrorKind::*;
1010

11-
use {
11+
use crate::{
1212
ControllIdentifier, ControllerInternal, Controllers, DeviceResource, DeviceResources,
1313
Resources, Subsystem,
1414
};

src/freezer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
use std::io::{Read, Write};
66
use std::path::PathBuf;
77

8-
use error::*;
9-
use error::ErrorKind::*;
8+
use crate::error::*;
9+
use crate::error::ErrorKind::*;
1010

11-
use {ControllIdentifier, ControllerInternal, Controllers, Resources, Subsystem};
11+
use crate::{ControllIdentifier, ControllerInternal, Controllers, Resources, Subsystem};
1212

1313
/// A controller that allows controlling the `freezer` subsystem of a Cgroup.
1414
///

src/hierarchies.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ use std::io::BufRead;
88
use std::io::BufReader;
99
use std::path::{Path, PathBuf};
1010

11-
use blkio::BlkIoController;
12-
use cpu::CpuController;
13-
use cpuacct::CpuAcctController;
14-
use cpuset::CpuSetController;
15-
use devices::DevicesController;
16-
use freezer::FreezerController;
17-
use hugetlb::HugeTlbController;
18-
use memory::MemController;
19-
use net_cls::NetClsController;
20-
use net_prio::NetPrioController;
21-
use perf_event::PerfEventController;
22-
use pid::PidController;
23-
use rdma::RdmaController;
24-
use {Controllers, Hierarchy, Subsystem};
11+
use crate::blkio::BlkIoController;
12+
use crate::cpu::CpuController;
13+
use crate::cpuacct::CpuAcctController;
14+
use crate::cpuset::CpuSetController;
15+
use crate::devices::DevicesController;
16+
use crate::freezer::FreezerController;
17+
use crate::hugetlb::HugeTlbController;
18+
use crate::memory::MemController;
19+
use crate::net_cls::NetClsController;
20+
use crate::net_prio::NetPrioController;
21+
use crate::perf_event::PerfEventController;
22+
use crate::pid::PidController;
23+
use crate::rdma::RdmaController;
24+
use crate::{Controllers, Hierarchy, Subsystem};
2525

26-
use cgroup::Cgroup;
26+
use crate::cgroup::Cgroup;
2727

2828
/// The standard, original cgroup implementation. Often referred to as "cgroupv1".
2929
pub struct V1 {

src/hugetlb.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ use std::fs::File;
66
use std::io::{Read, Write};
77
use std::path::PathBuf;
88

9-
use error::*;
10-
use error::ErrorKind::*;
9+
use crate::error::*;
10+
use crate::error::ErrorKind::*;
1111

12-
use {
12+
use crate::{
1313
ControllIdentifier, ControllerInternal, Controllers, HugePageResources, Resources,
1414
Subsystem,
1515
};

0 commit comments

Comments
 (0)