diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-07-09 12:51:10 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-07-15 12:47:53 +0200 |
commit | 775f0c039349335df880d35db7df6c131419f0eb (patch) | |
tree | 2d16928f3a629b7afae95cf1b9d518c5603a9f93 /openpgp | |
parent | caec575e3c44e6045e29aa452ad31f91d04ec139 (diff) |
Prepare for Rust 2018.
- This is the result of running `cargo fix --edition`, with some
manual adjustments.
- The vast majority of changes merely qualify module paths with
'crate::'.
- Two instances of adding an anonymous pattern to a trait's
function.
- `async` is a keyword in Rust 2018, and hence it needs to be
escaped (e.g. in the case of the net::r#async module).
- The manual adjustments were needed due to various shortcomings of
the analysis employed by `cargo fix`, e.g. unexpanded macros,
procedural macros, lalrpop grammars.
Diffstat (limited to 'openpgp')
76 files changed, 788 insertions, 788 deletions
diff --git a/openpgp/examples/decrypt-with.rs b/openpgp/examples/decrypt-with.rs index 75b886eb..6562b3db 100644 --- a/openpgp/examples/decrypt-with.rs +++ b/openpgp/examples/decrypt-with.rs @@ -8,9 +8,9 @@ use std::io; extern crate failure; extern crate sequoia_openpgp as openpgp; -use openpgp::crypto::{KeyPair, SessionKey}; -use openpgp::constants::SymmetricAlgorithm; -use openpgp::parse::{ +use crate::openpgp::crypto::{KeyPair, SessionKey}; +use crate::openpgp::constants::SymmetricAlgorithm; +use crate::openpgp::parse::{ Parse, stream::{ DecryptionHelper, diff --git a/openpgp/examples/encrypt-for.rs b/openpgp/examples/encrypt-for.rs index 3fd1217c..9b35623b 100644 --- a/openpgp/examples/encrypt-for.rs +++ b/openpgp/examples/encrypt-for.rs @@ -5,10 +5,10 @@ use std::env; use std::io; extern crate sequoia_openpgp as openpgp; -use openpgp::armor; -use openpgp::constants::DataFormat; -use openpgp::parse::Parse; -use openpgp::serialize::stream::{ +use crate::openpgp::armor; +use crate::openpgp::constants::DataFormat; +use crate::openpgp::parse::Parse; +use crate::openpgp::serialize::stream::{ Message, LiteralWriter, Encryptor, EncryptionMode, }; diff --git a/openpgp/examples/generate-encrypt-decrypt.rs b/openpgp/examples/generate-encrypt-decrypt.rs index 8a450d24..50159825 100644 --- a/openpgp/examples/generate-encrypt-decrypt.rs +++ b/openpgp/examples/generate-encrypt-decrypt.rs @@ -3,10 +3,10 @@ use std::io::{self, Write}; extern crate sequoia_openpgp as openpgp; -use openpgp::crypto::SessionKey; -use openpgp::constants::SymmetricAlgorithm; -use openpgp::serialize::stream::*; -use openpgp::parse::stream::*; +use crate::openpgp::crypto::SessionKey; +use crate::openpgp::constants::SymmetricAlgorithm; +use crate::openpgp::serialize::stream::*; +use crate::openpgp::parse::stream::*; const MESSAGE: &'static str = "дружба"; diff --git a/openpgp/examples/generate-sign-verify.rs b/openpgp/examples/generate-sign-verify.rs index 70899c81..cc350a63 100644 --- a/openpgp/examples/generate-sign-verify.rs +++ b/openpgp/examples/generate-sign-verify.rs @@ -4,8 +4,8 @@ use std::io::{self, Write}; extern crate failure; extern crate sequoia_openpgp as openpgp; -use openpgp::serialize::stream::*; -use openpgp::parse::stream::*; +use crate::openpgp::serialize::stream::*; +use crate::openpgp::parse::stream::*; const MESSAGE: &'static str = "дружба"; diff --git a/openpgp/examples/notarize.rs b/openpgp/examples/notarize.rs index fd1c56b1..54c7fa79 100644 --- a/openpgp/examples/notarize.rs +++ b/openpgp/examples/notarize.rs @@ -5,7 +5,7 @@ use std::env; use std::io; extern crate sequoia_openpgp as openpgp; -use openpgp::{ +use crate::openpgp::{ armor, crypto, Packet, @@ -13,7 +13,7 @@ use openpgp::{ parse::{Parse, PacketParserResult}, serialize::Serialize, }; -use openpgp::serialize::stream::{Message, LiteralWriter, Signer}; +use crate::openpgp::serialize::stream::{Message, LiteralWriter, Signer}; fn main() { let args: Vec<String> = env::args().collect(); diff --git a/openpgp/examples/sign-detached.rs b/openpgp/examples/sign-detached.rs index a4ee95ad..30620eb3 100644 --- a/openpgp/examples/sign-detached.rs +++ b/openpgp/examples/sign-detached.rs @@ -5,10 +5,10 @@ use std::io; extern crate rpassword; extern crate sequoia_openpgp as openpgp; -use openpgp::armor; -use openpgp::crypto; -use openpgp::parse::Parse; -use openpgp::serialize::stream::{Message, Signer}; +use crate::openpgp::armor; +use crate::openpgp::crypto; +use crate::openpgp::parse::Parse; +use crate::openpgp::serialize::stream::{Message, Signer}; fn main() { let args: Vec<String> = env::args().collect(); diff --git a/openpgp/examples/sign.rs b/openpgp/examples/sign.rs index 637679ab..cfd9c136 100644 --- a/openpgp/examples/sign.rs +++ b/openpgp/examples/sign.rs @@ -4,11 +4,11 @@ use std::env; use std::io; extern crate sequoia_openpgp as openpgp; -use openpgp::armor; -use openpgp::crypto; -use openpgp::constants::DataFormat; -use openpgp::parse::Parse; -use openpgp::serialize::stream::{Message, LiteralWriter, Signer}; +use crate::openpgp::armor; +use crate::openpgp::crypto; +use crate::openpgp::constants::DataFormat; +use crate::openpgp::parse::Parse; +use crate::openpgp::serialize::stream::{Message, LiteralWriter, Signer}; fn main() { let args: Vec<String> = env::args().collect(); diff --git a/openpgp/examples/statistics.rs b/openpgp/examples/statistics.rs index 00bbadba..9bfdd94e 100644 --- a/openpgp/examples/statistics.rs +++ b/openpgp/examples/statistics.rs @@ -9,10 +9,10 @@ use std::env; extern crate sequoia_openpgp as openpgp; -use openpgp::Packet; -use openpgp::constants::SignatureType; -use openpgp::packet::{user_attribute, BodyLength, Tag}; -use openpgp::parse::{Parse, PacketParserResult, PacketParser}; +use crate::openpgp::Packet; +use crate::openpgp::constants::SignatureType; +use crate::openpgp::packet::{user_attribute, BodyLength, Tag}; +use crate::openpgp::parse::{Parse, PacketParserResult, PacketParser}; fn main() { let args: Vec<String> = env::args().collect(); @@ -95,7 +95,7 @@ fn main() { for (_offset, len, sub) in sig.hashed_area().iter() .chain(sig.unhashed_area().iter()) { - use openpgp::packet::signature::subpacket::*; + use crate::openpgp::packet::signature::subpacket::*; let i = u8::from(sub.tag) as usize; sigs_subpacket_tags_count[i] += 1; if let SubpacketValue::Unknown(_) = sub.value { @@ -116,8 +116,8 @@ fn main() { }, Packet::UserAttribute(ref ua) => { - use user_attribute::Subpacket; - use user_attribute::Image; + use crate::user_attribute::Subpacket; + use crate::user_attribute::Image; for subpacket in ua.subpackets() { match subpacket { Ok(Subpacket::Image(i)) => match i { @@ -215,7 +215,7 @@ fn main() { ----------------------"); for t in 0..256 { - use openpgp::packet::signature::subpacket::SubpacketTag; + use crate::openpgp::packet::signature::subpacket::SubpacketTag; let count = sigs_subpacket_tags_count[t]; let size_count = sigs_subpacket_tags_size_count[t]; let tag_name = format!("{:?}", SubpacketTag::from(t as u8)); diff --git a/openpgp/examples/web-of-trust.rs b/openpgp/examples/web-of-trust.rs index bfdd1558..1fa4845b 100644 --- a/openpgp/examples/web-of-trust.rs +++ b/ |