diff --git a/Cargo.toml b/Cargo.toml index 6444e9a..618cccf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,8 @@ readme = "README.md" repository = "https://github.com/FauxFaux/apt-pkg-native-rs" version = "0.3.0" +edition = "2018" + [badges.travis-ci] repository = "FauxFaux/apt-pkg-native-rs" diff --git a/examples/epochs.rs b/examples/epochs.rs index 78574e8..df21bda 100644 --- a/examples/epochs.rs +++ b/examples/epochs.rs @@ -1,6 +1,3 @@ -extern crate apt_pkg_native; -extern crate boolinator; - use apt_pkg_native::Cache; use boolinator::Boolinator; diff --git a/examples/list.rs b/examples/list.rs index 87e79f0..4fe35e0 100644 --- a/examples/list.rs +++ b/examples/list.rs @@ -1,6 +1,3 @@ -extern crate apt_pkg_native; -extern crate itertools; - use itertools::Itertools; use apt_pkg_native::simple; diff --git a/examples/policy.rs b/examples/policy.rs index a1abbc7..02ab3b5 100644 --- a/examples/policy.rs +++ b/examples/policy.rs @@ -1,4 +1,3 @@ -extern crate apt_pkg_native; use std::env; use apt_pkg_native::simple; diff --git a/examples/sources.rs b/examples/sources.rs index 29d0a9f..d8e56d4 100644 --- a/examples/sources.rs +++ b/examples/sources.rs @@ -1,3 +1,5 @@ +use std::collections::HashMap; +use std::collections::HashSet; /// A port of a randomly selected Python program: /// /// ```python @@ -23,12 +25,8 @@ /// for ver in sorted(sources[src]): /// print('{}={}'.format(src, ver)) /// ``` -extern crate apt_pkg_native; use std::env; -use std::collections::HashMap; -use std::collections::HashSet; - use apt_pkg_native::Cache; fn main() { diff --git a/src/lib.rs b/src/lib.rs index 0276274..ff9ee34 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -31,16 +31,12 @@ //! `libapt-pkg` also just segfaults if you do anything wrong, or re-use anything at the wrong time, //! or etc. I've tried to hide this, but I advise you not to push or outsmart the borrow checker. -#[macro_use] -extern crate lazy_static; -extern crate libc; - mod citer; mod raw; mod sane; pub mod simple; -pub use sane::Cache; +pub use crate::sane::Cache; #[cfg(test)] mod tests { diff --git a/src/raw.rs b/src/raw.rs index c39b229..7bdd0a9 100644 --- a/src/raw.rs +++ b/src/raw.rs @@ -4,6 +4,7 @@ /// * `*mut c_chars` are to be freed by `libc::free`. use std::sync::Mutex; +use lazy_static::lazy_static; use libc::c_char; use libc::c_void; diff --git a/src/sane.rs b/src/sane.rs index bcb98db..d4efad0 100644 --- a/src/sane.rs +++ b/src/sane.rs @@ -4,10 +4,10 @@ use std::marker::PhantomData; use std::sync::MutexGuard; use libc; -use raw; -use citer::CIterator; -use citer::RawIterator; +use crate::citer::CIterator; +use crate::citer::RawIterator; +use crate::raw; /// A reference to the package cache singleton, /// from which most functionality can be accessed. diff --git a/src/simple.rs b/src/simple.rs index 861f44e..c16b3d4 100644 --- a/src/simple.rs +++ b/src/simple.rs @@ -2,7 +2,7 @@ use std::fmt; -use sane; +use crate::sane; #[derive(Clone, Debug)] pub struct BinaryPackage {