Skip to content

Commit 2c37b48

Browse files
committed
edition 2018
1 parent 1e14e5b commit 2c37b48

File tree

25 files changed

+65
-51
lines changed

25 files changed

+65
-51
lines changed

examples/example/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "example"
33
version = "2.0.0"
44
authors = ["Harald Hoyer <[email protected]>"]
55
build = "build.rs"
6+
edition = "2018"
67

78
[dependencies]
89
varlink = { path = "../../varlink" }

examples/example/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use varlink::{Connection, OrgVarlinkServiceInterface, VarlinkService};
1313

1414
mod io_systemd_network;
1515

16-
use io_systemd_network::VarlinkClientInterface;
16+
use crate::io_systemd_network::VarlinkClientInterface;
1717

1818
#[cfg(test)]
1919
mod test;

examples/example/src/test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use failure::Fail;
2-
use io_systemd_network::Result;
2+
use crate::io_systemd_network::Result;
33
use std::io;
44
use std::{thread, time};
55
use varlink::Connection;
66

77
fn run_self_test(address: &'static str) -> Result<()> {
88
let child = thread::spawn(move || {
9-
if let Err(e) = ::run_server(address, 4) {
9+
if let Err(e) = crate::run_server(address, 4) {
1010
if e.kind() != ::varlink::ErrorKind::Timeout {
1111
panic!("error: {:#?}", e.cause());
1212
}
@@ -16,7 +16,7 @@ fn run_self_test(address: &'static str) -> Result<()> {
1616
// give server time to start
1717
thread::sleep(time::Duration::from_secs(1));
1818

19-
let ret = ::run_client(Connection::with_address(&address)?);
19+
let ret = crate::run_client(Connection::with_address(&address)?);
2020
if let Err(e) = ret {
2121
panic!("error: {}", e);
2222
}

examples/more/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "more"
33
version = "2.0.0"
44
authors = ["Harald Hoyer <[email protected]>"]
55
build = "build.rs"
6+
edition = "2018"
67

78
[dependencies]
89
varlink = { path = "../../varlink" }

examples/more/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ extern crate serde_derive;
66
extern crate serde_json;
77
extern crate varlink;
88

9-
use org_example_more::*;
9+
use crate::org_example_more::*;
1010
use std::env;
1111
use std::process::exit;
1212
use std::sync::{Arc, RwLock};

examples/more/src/test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
use std::io;
22
use std::{thread, time};
33
use varlink::Connection;
4-
use Result;
4+
use crate::Result;
55

66
fn run_self_test(address: String) -> Result<()> {
77
let client_address = address.clone();
88

99
let child = thread::spawn(move || {
10-
if let Err(e) = ::run_server(&address, 4, 100) {
10+
if let Err(e) = crate::run_server(&address, 4, 100) {
1111
match e.kind() {
1212
::varlink::ErrorKind::Timeout => {}
1313
_ => panic!("error: {}", e),
@@ -18,7 +18,7 @@ fn run_self_test(address: String) -> Result<()> {
1818
// give server time to start
1919
thread::sleep(time::Duration::from_secs(1));
2020

21-
let ret = ::run_client(Connection::with_address(&client_address)?);
21+
let ret = crate::run_client(Connection::with_address(&client_address)?);
2222
if let Err(e) = ret {
2323
panic!("error: {}", e);
2424
}

examples/ping/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "ping"
33
version = "2.0.0"
44
authors = ["Harald Hoyer <[email protected]>"]
55
build = "build.rs"
6+
edition = "2018"
67

78
[dependencies]
89
varlink = { path = "../../varlink" }

examples/ping/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extern crate serde_derive;
77
extern crate serde_json;
88
extern crate varlink;
99

10-
use org_example_ping::*;
10+
use crate::org_example_ping::*;
1111
use std::env;
1212
use std::io::{BufRead, Read, Write};
1313
use std::process::exit;
@@ -252,7 +252,7 @@ mod multiplex {
252252
for (i, fds_item) in fds.iter().enumerate().skip(1) {
253253
if fds_item.revents != 0 {
254254
let mut upgraded_iface: Option<String> = None;
255-
let mut tracker = fdmap.get_mut(&fds_item.fd).unwrap();
255+
let tracker = fdmap.get_mut(&fds_item.fd).unwrap();
256256
loop {
257257
let mut readbuf: [u8; 8192] = [0; 8192];
258258

@@ -329,8 +329,8 @@ mod multiplex {
329329
eprintln!("upgraded thread");
330330
let handler = handler.clone();
331331
let mut stream = tracker.stream.take().unwrap();
332-
let mut buffer = tracker.buffer.take().unwrap();
333-
let mut upgraded_in_use = upgraded_in_use.clone();
332+
let buffer = tracker.buffer.take().unwrap();
333+
let upgraded_in_use = upgraded_in_use.clone();
334334
move || {
335335
let _r = stream.set_nonblocking(false);
336336
let (reader, mut writer) = stream.split().unwrap();

examples/ping/src/test.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
use std::io::{self, BufRead};
22
use std::{thread, time};
33
use varlink::Connection;
4-
use Result;
4+
use crate::Result;
55

66
fn run_self_test(address: String, multiplex: bool) -> Result<()> {
77
let server_address = address.clone();
88

99
let child = thread::spawn(move || {
10-
if let Err(e) = ::run_server(&server_address, 4, multiplex) {
10+
if let Err(e) = crate::run_server(&server_address, 4, multiplex) {
1111
match e.kind() {
1212
::varlink::ErrorKind::Timeout => {}
1313
_ => panic!("error: {}", e),
@@ -36,7 +36,7 @@ fn run_self_test(address: String, multiplex: bool) -> Result<()> {
3636
let b = &br[10..20];
3737
let c = &br[20..];
3838

39-
for mut i in vec![a, b, c] {
39+
for i in vec![a, b, c] {
4040
assert!(writer.write_all(i).is_ok());
4141
assert!(writer.flush().is_ok());
4242
thread::sleep(time::Duration::from_millis(500));
@@ -80,7 +80,7 @@ fn run_self_test(address: String, multiplex: bool) -> Result<()> {
8080
let b = &br[10..20];
8181
let c = &br[20..];
8282

83-
for mut i in vec![a, b, c] {
83+
for i in vec![a, b, c] {
8484
assert!(writer.write_all(i).is_ok());
8585
assert!(writer.flush().is_ok());
8686
thread::sleep(time::Duration::from_millis(500));
@@ -109,7 +109,7 @@ fn run_self_test(address: String, multiplex: bool) -> Result<()> {
109109
let b = &br[10..20];
110110
let c = &br[20..];
111111

112-
for mut i in vec![a, b, c] {
112+
for i in vec![a, b, c] {
113113
assert!(writer.write_all(i).is_ok());
114114
assert!(writer.flush().is_ok());
115115
thread::sleep(time::Duration::from_millis(500));
@@ -132,7 +132,7 @@ fn run_self_test(address: String, multiplex: bool) -> Result<()> {
132132
{
133133
let con = Connection::with_address(&address)?;
134134

135-
let ret = ::run_client(&con);
135+
let ret = crate::run_client(&con);
136136
if let Err(e) = ret {
137137
panic!("error: {:#?}", e);
138138
}

varlink-certification/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "varlink-certification"
33
version = "2.0.1"
44
authors = ["Harald Hoyer <[email protected]>"]
55
build = "build.rs"
6+
edition = "2018"
67

78
[dependencies]
89
varlink = { version = "5.0", path = "../varlink" }

varlink-certification/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ extern crate serde_derive;
88
extern crate serde_json;
99
extern crate varlink;
1010

11-
use org_varlink_certification::*;
11+
use crate::org_varlink_certification::*;
1212
use std::collections::{hash_map::DefaultHasher, VecDeque};
1313
use std::env;
1414
use std::hash::{Hash, Hasher};

varlink-certification/src/test.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
use std::io;
22
use std::{thread, time};
33
use varlink::Connection;
4-
use Result;
4+
use crate::Result;
55

66
fn run_self_test(address: String) -> Result<()> {
77
let client_address = address.clone();
88

99
let child = thread::spawn(move || {
10-
if let Err(e) = ::run_server(&address, 4) {
10+
if let Err(e) = crate::run_server(&address, 4) {
1111
match e.kind() {
1212
::varlink::ErrorKind::Timeout => {}
1313
_ => panic!("error: {}", e),
@@ -18,7 +18,7 @@ fn run_self_test(address: String) -> Result<()> {
1818
// give server time to start
1919
thread::sleep(time::Duration::from_secs(1));
2020

21-
let ret = ::run_client(Connection::with_address(&client_address)?);
21+
let ret = crate::run_client(Connection::with_address(&client_address)?);
2222
if let Err(e) = ret {
2323
panic!("error: {:?}", e);
2424
}
@@ -30,7 +30,7 @@ fn run_self_test(address: String) -> Result<()> {
3030
}
3131

3232
#[test]
33-
fn test_unix() -> ::Result<()> {
33+
fn test_unix() -> crate::Result<()> {
3434
run_self_test("unix:org.varlink.certification".into())
3535
}
3636

@@ -54,17 +54,17 @@ fn test_exec() -> Result<()> {
5454
let runner = CargoBuild::new()
5555
.current_release()
5656
.run()
57-
.context(::ErrorKind::Io_Error(::std::io::ErrorKind::NotFound))?;
57+
.context(crate::ErrorKind::Io_Error(::std::io::ErrorKind::NotFound))?;
5858
Ok(runner.path().to_owned().to_string_lossy().to_string())
5959
}
6060

61-
::run_client(Connection::with_activate(&format!(
61+
crate::run_client(Connection::with_activate(&format!(
6262
"{} --varlink=$VARLINK_ADDRESS",
6363
get_exec()?
6464
))?)
6565
}
6666

6767
#[test]
6868
fn test_wrong_address_1() {
69-
assert!(::run_server("tcpd:0.0.0.0:12345".into(), 1).is_err());
69+
assert!(crate::run_server("tcpd:0.0.0.0:12345".into(), 1).is_err());
7070
}

varlink-cli/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
name = "varlink-cli"
33
version = "3.0.1"
44
authors = ["Harald Hoyer <[email protected]>"]
5+
edition = "2018"
6+
57
license = "MIT/Apache-2.0"
68
documentation = "https://github.com/varlink/rust/blob/master/varlink/README.md"
79
homepage = "https://github.com/varlink/rust/blob/master/varlink"

varlink-cli/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ extern crate varlink_stdinterfaces;
1111

1212
use clap::{App, Arg, SubCommand};
1313
use colored_json::{ColorMode, ColoredFormatter, Colour, Output, PrettyFormatter, Style, Styler};
14-
use error::{ErrorKind, Result};
14+
use crate::error::{ErrorKind, Result};
1515
use failure::ResultExt;
1616
#[cfg(unix)]
17-
use proxy::{handle, handle_connect};
17+
use crate::proxy::{handle, handle_connect};
1818
use std::fs::File;
1919
use std::io;
2020
use std::io::prelude::*;

varlink/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
name = "varlink"
33
version = "5.0.1"
44
authors = ["Harald Hoyer <[email protected]>"]
5+
edition = "2018"
6+
57
license = "MIT/Apache-2.0"
68
documentation = "https://github.com/varlink/rust/blob/master/varlink/README.md"
79
homepage = "https://github.com/varlink/rust/blob/master/varlink"

varlink/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::os::unix::net::UnixStream;
1616
#[cfg(windows)]
1717
use uds_windows::UnixStream;
1818

19-
use {ErrorKind, Result};
19+
use crate::{ErrorKind, Result};
2020

2121
pub enum VarlinkStream {
2222
TCP(TcpStream),

varlink/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub enum ErrorKind {
2222
#[fail(display = "Method not implemented: '{}'", _0)]
2323
MethodNotImplemented(String),
2424
#[fail(display = "Unknown error reply: '{:#?}'", _0)]
25-
VarlinkErrorReply(::Reply),
25+
VarlinkErrorReply(crate::Reply),
2626
#[fail(display = "Call::reply() called with continues, but without more in the request")]
2727
CallContinuesMismatch,
2828
#[fail(display = "Varlink: method called already")]

varlink/src/lib.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -243,15 +243,15 @@ extern crate unix_socket;
243243
#[cfg(windows)]
244244
extern crate winapi;
245245

246-
pub use client::VarlinkStream;
247-
use client::{varlink_bridge, varlink_exec};
248-
pub use error::{Error, ErrorKind, Result};
246+
pub use crate::client::VarlinkStream;
247+
use crate::client::{varlink_bridge, varlink_exec};
248+
pub use crate::error::{Error, ErrorKind, Result};
249249
use failure::ResultExt;
250250
use serde::de::{self, DeserializeOwned};
251251
use serde::ser::{Serialize, SerializeMap, Serializer};
252252
use serde_json::Value;
253-
pub use server::Stream as ServerStream;
254-
pub use server::{listen, Listener};
253+
pub use crate::server::Stream as ServerStream;
254+
pub use crate::server::{listen, Listener};
255255
use std::borrow::Cow;
256256
use std::collections::{HashMap, HashSet};
257257
use std::convert::From;
@@ -546,8 +546,8 @@ where
546546
# Examples
547547
548548
```rust
549-
# #[allow(non_camel_case_types)]
550-
# #[allow(non_snake_case)]
549+
# #![allow(non_camel_case_types)]
550+
# #![allow(non_snake_case)]
551551
# use std::io;
552552
# pub trait VarlinkCallError: varlink::CallTrait {}
553553
# impl<'a> VarlinkCallError for varlink::Call<'a> {}
@@ -583,8 +583,8 @@ pub struct Call<'a> {
583583
For an invalid parameter:
584584
585585
```rust
586-
# #[allow(non_camel_case_types)]
587-
# #[allow(non_snake_case)]
586+
# #![allow(non_camel_case_types)]
587+
# #![allow(non_snake_case)]
588588
# use std::io;
589589
# pub trait VarlinkCallError: varlink::CallTrait {}
590590
# impl<'a> VarlinkCallError for varlink::Call<'a> {}
@@ -613,8 +613,8 @@ pub struct Call<'a> {
613613
For not yet implemented methods:
614614
615615
```rust
616-
# #[allow(non_camel_case_types)]
617-
# #[allow(non_snake_case)]
616+
# #![allow(non_camel_case_types)]
617+
# #![allow(non_snake_case)]
618618
# use std::io;
619619
# pub trait VarlinkCallError: varlink::CallTrait {}
620620
# impl<'a> VarlinkCallError for varlink::Call<'a> {}
@@ -644,8 +644,8 @@ pub trait CallTrait {
644644
# Examples
645645
646646
```rust
647-
# #[allow(non_camel_case_types)]
648-
# #[allow(non_snake_case)]
647+
# #![allow(non_camel_case_types)]
648+
# #![allow(non_snake_case)]
649649
# use std::io;
650650
# pub trait VarlinkCallError: varlink::CallTrait {}
651651
# impl<'a> VarlinkCallError for varlink::Call<'a> {}

varlink/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![allow(dead_code)]
33

44
use failure::Fail;
5-
use {ErrorKind, Result};
5+
use crate::{ErrorKind, Result};
66
//#![feature(getpid)]
77
//use std::process;
88
use std::io::{BufRead, BufReader, Read, Write};

varlink/src/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use serde_json::{from_slice, from_value};
22
use std::{thread, time};
3-
use *;
3+
use crate::*;
44

55
#[test]
66
fn test_listen() -> Result<()> {

varlink_generator/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
name = "varlink_generator"
33
version = "5.1.1"
44
authors = ["Harald Hoyer <[email protected]>"]
5+
edition = "2018"
6+
57
license = "MIT/Apache-2.0"
68
documentation = "https://github.com/varlink/rust/blob/master/varlink/README.md"
79
homepage = "https://github.com/varlink/rust/blob/master/varlink"

varlink_parser/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
name = "varlink_parser"
33
version = "2.2.2"
44
authors = ["Harald Hoyer <[email protected]>"]
5+
edition = "2018"
6+
57
license = "MIT/Apache-2.0"
68
documentation = "https://docs.rs/varlink_parser/"
79
homepage = "https://github.com/varlink/rust"

varlink_parser/src/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use *;
1+
use crate::*;
22

33
#[test]
44
fn test_standard() {

0 commit comments

Comments
 (0)