@@ -131,7 +131,7 @@ pub enum Item<'p> {
131
131
132
132
/// Unescape a byte array according to the composefs dump file escaping format,
133
133
/// limiting the maximum possible size.
134
- fn unescape_limited ( s : & str , max : usize ) -> Result < Cow < [ u8 ] > > {
134
+ fn unescape_limited ( s : & str , max : usize ) -> Result < Cow < ' _ , [ u8 ] > > {
135
135
// If there are no escapes, just return the input unchanged. However,
136
136
// it must also be ASCII to maintain a 1-1 correspondence between byte
137
137
// and character.
@@ -179,13 +179,13 @@ fn unescape_limited(s: &str, max: usize) -> Result<Cow<[u8]>> {
179
179
}
180
180
181
181
/// Unescape a byte array according to the composefs dump file escaping format.
182
- fn unescape ( s : & str ) -> Result < Cow < [ u8 ] > > {
182
+ fn unescape ( s : & str ) -> Result < Cow < ' _ , [ u8 ] > > {
183
183
unescape_limited ( s, usize:: MAX )
184
184
}
185
185
186
186
/// Unescape a string into a Rust `OsStr` which is really just an alias for a byte array,
187
187
/// but we also impose a constraint that it can not have an embedded NUL byte.
188
- fn unescape_to_osstr ( s : & str ) -> Result < Cow < OsStr > > {
188
+ fn unescape_to_osstr ( s : & str ) -> Result < Cow < ' _ , OsStr > > {
189
189
let v = unescape ( s) ?;
190
190
if v. contains ( & 0u8 ) {
191
191
anyhow:: bail!( "Invalid embedded NUL" ) ;
@@ -201,7 +201,7 @@ fn unescape_to_osstr(s: &str) -> Result<Cow<OsStr>> {
201
201
/// with a few constraints:
202
202
/// - Cannot contain an embedded NUL
203
203
/// - Cannot be empty, or longer than PATH_MAX
204
- fn unescape_to_path ( s : & str ) -> Result < Cow < Path > > {
204
+ fn unescape_to_path ( s : & str ) -> Result < Cow < ' _ , Path > > {
205
205
let v = unescape_to_osstr ( s) . and_then ( |v| {
206
206
if v. is_empty ( ) {
207
207
anyhow:: bail!( "Invalid empty path" ) ;
@@ -224,7 +224,7 @@ fn unescape_to_path(s: &str) -> Result<Cow<Path>> {
224
224
/// which in particular removes `.` and extra `//`.
225
225
///
226
226
/// We also deny uplinks `..` and empty paths.
227
- fn unescape_to_path_canonical ( s : & str ) -> Result < Cow < Path > > {
227
+ fn unescape_to_path_canonical ( s : & str ) -> Result < Cow < ' _ , Path > > {
228
228
let p = unescape_to_path ( s) ?;
229
229
let mut components = p. components ( ) ;
230
230
let mut r = std:: path:: PathBuf :: new ( ) ;
0 commit comments