3
3
//! These are shared between the client implementation in the `age` crate, and the plugin
4
4
//! implementations built around the `age-plugin` crate.
5
5
6
- use rand:: { rng , Rng } ;
6
+ use rand:: { Rng , rng } ;
7
7
use secrecy:: zeroize:: Zeroize ;
8
8
use std:: env;
9
9
use std:: fmt;
@@ -13,7 +13,7 @@ use std::path::Path;
13
13
use std:: process:: { ChildStdin , ChildStdout , Command , Stdio } ;
14
14
15
15
use crate :: {
16
- format:: { grease_the_joint, read, write, Stanza } ,
16
+ format:: { Stanza , grease_the_joint, read, write} ,
17
17
io:: { DebugReader , DebugWriter } ,
18
18
} ;
19
19
@@ -124,7 +124,7 @@ impl<R: Read, W: Write> Connection<R, W> {
124
124
cookie_factory:: gen_simple ( write:: age_stanza ( command, metadata, data) , & mut self . output )
125
125
. map_err ( |e| match e {
126
126
GenError :: IoError ( e) => e,
127
- e => io:: Error :: new ( io :: ErrorKind :: Other , format ! ( "{}" , e) ) ,
127
+ e => io:: Error :: other ( format ! ( "{}" , e) ) ,
128
128
} )
129
129
. and_then ( |w| w. flush ( ) )
130
130
}
@@ -174,7 +174,7 @@ impl<R: Read, W: Write> Connection<R, W> {
174
174
Ok ( stanza)
175
175
}
176
176
177
- fn grease_gun ( & mut self ) -> impl Iterator < Item = Stanza > {
177
+ fn grease_gun ( & mut self ) -> impl Iterator < Item = Stanza > + use < R , W > {
178
178
// Add 5% grease
179
179
let mut rng = rng ( ) ;
180
180
( 0 ..2 ) . filter_map ( move |_| {
@@ -313,7 +313,7 @@ impl<R: Read, W: Write> Connection<R, W> {
313
313
/// Grease is applied automatically.
314
314
pub struct UnidirSend < ' a , R : Read , W : Write > ( & ' a mut Connection < R , W > ) ;
315
315
316
- impl < ' a , R : Read , W : Write > UnidirSend < ' a , R , W > {
316
+ impl < R : Read , W : Write > UnidirSend < ' _ , R , W > {
317
317
/// Send a command.
318
318
pub fn send ( & mut self , command : & str , metadata : & [ & str ] , data : & [ u8 ] ) -> io:: Result < ( ) > {
319
319
for grease in self . 0 . grease_gun ( ) {
@@ -341,7 +341,7 @@ impl<'a, R: Read, W: Write> UnidirSend<'a, R, W> {
341
341
/// Grease is applied automatically.
342
342
pub struct BidirSend < ' a , R : Read , W : Write > ( & ' a mut Connection < R , W > ) ;
343
343
344
- impl < ' a , R : Read , W : Write > BidirSend < ' a , R , W > {
344
+ impl < R : Read , W : Write > BidirSend < ' _ , R , W > {
345
345
/// Send a command and receive a response.
346
346
pub fn send ( & mut self , command : & str , metadata : & [ & str ] , data : & [ u8 ] ) -> Result < Stanza > {
347
347
for grease in self . 0 . grease_gun ( ) {
@@ -389,7 +389,7 @@ impl<'a, R: Read, W: Write> BidirSend<'a, R, W> {
389
389
/// The possible replies to a bidirectional command.
390
390
pub struct Reply < ' a , R : Read , W : Write > ( & ' a mut Connection < R , W > ) ;
391
391
392
- impl < ' a , R : Read , W : Write > Reply < ' a , R , W > {
392
+ impl < R : Read , W : Write > Reply < ' _ , R , W > {
393
393
/// Reply with `ok` and optional data.
394
394
pub fn ok ( self , data : Option < & [ u8 ] > ) -> Response {
395
395
Response (
0 commit comments