@@ -140,15 +140,15 @@ impl Display for PropertiesError {
140
140
struct NaturalLine ( usize , String ) ;
141
141
142
142
// We can't use BufRead.lines() because it doesn't use the proper line endings
143
- struct NaturalLines < ' a , R : Read > {
143
+ struct NaturalLines < R : Read > {
144
144
bytes : Peekable < Bytes < R > > ,
145
145
eof : bool ,
146
146
line_count : usize ,
147
- encoding : & ' a Encoding ,
147
+ encoding : & ' static Encoding ,
148
148
}
149
149
150
- impl < ' a , R : Read > NaturalLines < ' a , R > {
151
- fn new ( reader : R , encoding : & ' a Encoding ) -> Self {
150
+ impl < R : Read > NaturalLines < R > {
151
+ fn new ( reader : R , encoding : & ' static Encoding ) -> Self {
152
152
NaturalLines {
153
153
bytes : reader. bytes ( ) . peekable ( ) ,
154
154
eof : false ,
@@ -168,7 +168,7 @@ impl<'a, R: Read> NaturalLines<'a, R> {
168
168
const LF : u8 = 10 ;
169
169
const CR : u8 = 13 ;
170
170
171
- impl < ' a , R : Read > Iterator for NaturalLines < ' a , R > {
171
+ impl < R : Read > Iterator for NaturalLines < R > {
172
172
type Item = Result < NaturalLine , PropertiesError > ;
173
173
174
174
fn next ( & mut self ) -> Option < Self :: Item > {
@@ -487,12 +487,12 @@ impl LineParser {
487
487
///
488
488
/// For basic usage, see the crate-level documentation.
489
489
/// Note that once `next` returns an error, the result of further calls is undefined.
490
- pub struct PropertiesIter < ' a , R : Read > {
491
- lines : LogicalLines < NaturalLines < ' a , R > > ,
490
+ pub struct PropertiesIter < R : Read > {
491
+ lines : LogicalLines < NaturalLines < R > > ,
492
492
parser : LineParser ,
493
493
}
494
494
495
- impl < ' a , R : Read > PropertiesIter < ' a , R > {
495
+ impl < R : Read > PropertiesIter < R > {
496
496
/// Parses properties from the given `Read` stream.
497
497
pub fn new ( input : R ) -> Self {
498
498
Self :: new_with_encoding ( input, ISO_8859_1 )
@@ -501,7 +501,7 @@ impl<'a, R: Read> PropertiesIter<'a, R> {
501
501
/// Parses properties from the given `Read` stream in the given encoding.
502
502
/// Note that the Java properties specification specifies ISO-8859-1 encoding
503
503
/// for properties files; in most cases, `new` should be called instead.
504
- pub fn new_with_encoding ( input : R , encoding : Box < Encoding > ) -> Self {
504
+ pub fn new_with_encoding ( input : R , encoding : & ' static Encoding ) -> Self {
505
505
PropertiesIter {
506
506
lines : LogicalLines :: new ( NaturalLines :: new ( input, encoding) ) ,
507
507
parser : LineParser :: new ( ) ,
@@ -541,7 +541,7 @@ impl<'a, R: Read> PropertiesIter<'a, R> {
541
541
}
542
542
543
543
/// Note that once `next` returns an error, the result of further calls is undefined.
544
- impl < ' a , R : Read > Iterator for PropertiesIter < ' a , R > {
544
+ impl < R : Read > Iterator for PropertiesIter < R > {
545
545
type Item = Result < Line , PropertiesError > ;
546
546
547
547
/// Returns the next line.
0 commit comments