diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-10-14 11:36:45 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-10-14 12:01:22 +0200 |
commit | 57531dbe5b277a46982e4dd2b0ab6c20ebe43682 (patch) | |
tree | 9fddc14e92f2da4fd7c99c145d4c7ea76bf6a993 | |
parent | ea4eaf796404c0fde15509274190cc4668c5d08e (diff) |
Replace most 'extern crate' directives with 'use'.
- See #480.
89 files changed, 270 insertions, 327 deletions
diff --git a/buffered-reader/src/lib.rs b/buffered-reader/src/lib.rs index 32765d74..1b08e73c 100644 --- a/buffered-reader/src/lib.rs +++ b/buffered-reader/src/lib.rs @@ -223,12 +223,6 @@ //! [`BufReader`]: https://doc.rust-lang.org/stable/std/io/struct.BufReader.html //! [HTTP's chunk transfer encoding]: https://en.wikipedia.org/wiki/Chunked_transfer_encoding -#[cfg(feature = "compression-deflate")] -extern crate flate2; -#[cfg(feature = "compression-bzip2")] -extern crate bzip2; -extern crate libc; - use std::io; use std::io::{Error, ErrorKind}; use std::cmp; diff --git a/core/src/lib.rs b/core/src/lib.rs index 5db7e6bf..b1b39d2e 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -18,8 +18,8 @@ /// # } /// ``` -extern crate dirs; -extern crate tempfile; +use dirs; +use tempfile; use std::fmt; use std::io; diff --git a/ffi-macros/src/lib.rs b/ffi-macros/src/lib.rs index db37daef..6a3d2386 100644 --- a/ffi-macros/src/lib.rs +++ b/ffi-macros/src/lib.rs @@ -5,15 +5,13 @@ use std::collections::HashMap; use std::io::Write; -extern crate lazy_static; use lazy_static::lazy_static; -extern crate syn; +use syn; use syn::parse_quote; use syn::spanned::Spanned; -extern crate quote; -extern crate proc_macro; -extern crate proc_macro2; -extern crate sha2; +use proc_macro; +use proc_macro2; +use sha2; use proc_macro::TokenStream; use proc_macro2::TokenStream as TokenStream2; diff --git a/ffi-macros/src/rust2c.rs b/ffi-macros/src/rust2c.rs index 2e469703..d0e252f5 100644 --- a/ffi-macros/src/rust2c.rs +++ b/ffi-macros/src/rust2c.rs @@ -1,6 +1,6 @@ -extern crate syn; +use syn; use syn::export::ToTokens; -extern crate proc_macro2; +use proc_macro2; const PREFIX: &'static str = "pgp_"; diff --git a/ffi/src/error.rs b/ffi/src/error.rs index 26940111..935d4515 100644 --- a/ffi/src/error.rs +++ b/ffi/src/error.rs @@ -2,7 +2,7 @@ use std::io; -extern crate sequoia_openpgp as openpgp; +use sequoia_openpgp as openpgp; use sequoia_core as core; pub use crate::openpgp::error::Status; diff --git a/ffi/src/lib.rs b/ffi/src/lib.rs index ab2819ae..45844ded 100644 --- a/ffi/src/lib.rs +++ b/ffi/src/lib.rs @@ -107,20 +107,10 @@ #![warn(missing_docs)] -#[macro_use] -extern crate lazy_static; -extern crate libc; -extern crate native_tls; -extern crate memsec; - -extern crate sequoia_ffi_macros; +use sequoia_ffi_macros; use sequoia_ffi_macros::{ ffi_wrapper_type, }; -extern crate sequoia_openpgp; -extern crate sequoia_core; -extern crate sequoia_net; -extern crate sequoia_store; #[macro_use] pub mod openpgp { diff --git a/ffi/src/net.rs b/ffi/src/net.rs index 52fc7982..d386e92d 100644 --- a/ffi/src/net.rs +++ b/ffi/src/net.rs @@ -37,8 +37,7 @@ use native_tls::Certificate; use std::ptr; use std::slice; -extern crate sequoia_openpgp as openpgp; -extern crate tokio_core; +use tokio_core; use sequoia_net::KeyServer; diff --git a/ffi/src/store.rs b/ffi/src/store.rs index 5e6dce3d..408b02a5 100644 --- a/ffi/src/store.rs +++ b/ffi/src/store.rs @@ -26,8 +26,6 @@ use libc::c_char; use std::ptr; -extern crate sequoia_openpgp as openpgp; - use sequoia_store::{ self, Mapping, MappingIter, Binding, BundleIter, Key, KeyIter, LogIter, Store, }; diff --git a/ffi/tests/c-tests.rs b/ffi/tests/c-tests.rs index 7670f13b..e5af5c1f 100644 --- a/ffi/tests/c-tests.rs +++ b/ffi/tests/c-tests.rs @@ -1,5 +1,5 @@ use anyhow::{Result, Context}; -extern crate filetime; +use filetime; use std::cmp::min; use std::env::{self, var_os}; diff --git a/ipc/build.rs b/ipc/build.rs index 5c8a9ffb..f508b38e 100644 --- a/ipc/build.rs +++ b/ipc/build.rs @@ -2,7 +2,7 @@ use std::env; use std::fs; use std::io::{self, Write}; use std::path::PathBuf; -extern crate lalrpop; +use lalrpop; fn main() { lalrpop::process_root().unwrap(); diff --git a/ipc/examples/assuan-client.rs b/ipc/examples/assuan-c |