@@ -190,24 +190,24 @@ impl RawArgs {
190190 }
191191
192192 /// Advance the cursor, returning the next [`ParsedArg`]
193- pub fn next ( & self , cursor : & mut ArgCursor ) -> Option < ParsedArg < ' _ > > {
193+ pub fn next < ' s > ( & ' s self , cursor : & mut ArgCursor ) -> Option < ParsedArg < ' s > > {
194194 self . next_os ( cursor) . map ( ParsedArg :: new)
195195 }
196196
197197 /// Advance the cursor, returning a raw argument value.
198- pub fn next_os ( & self , cursor : & mut ArgCursor ) -> Option < & OsStr > {
198+ pub fn next_os < ' s > ( & ' s self , cursor : & mut ArgCursor ) -> Option < & ' s OsStr > {
199199 let next = self . items . get ( cursor. cursor ) . map ( |s| s. as_os_str ( ) ) ;
200200 cursor. cursor = cursor. cursor . saturating_add ( 1 ) ;
201201 next
202202 }
203203
204204 /// Return the next [`ParsedArg`]
205- pub fn peek ( & self , cursor : & ArgCursor ) -> Option < ParsedArg < ' _ > > {
205+ pub fn peek < ' s > ( & ' s self , cursor : & ArgCursor ) -> Option < ParsedArg < ' s > > {
206206 self . peek_os ( cursor) . map ( ParsedArg :: new)
207207 }
208208
209209 /// Return a raw argument value.
210- pub fn peek_os ( & self , cursor : & ArgCursor ) -> Option < & OsStr > {
210+ pub fn peek_os < ' s > ( & ' s self , cursor : & ArgCursor ) -> Option < & ' s OsStr > {
211211 self . items . get ( cursor. cursor ) . map ( |s| s. as_os_str ( ) )
212212 }
213213
@@ -224,7 +224,7 @@ impl RawArgs {
224224 /// let mut paths = raw.remaining(&mut cursor).map(PathBuf::from).collect::<Vec<_>>();
225225 /// println!("{paths:?}");
226226 /// ```
227- pub fn remaining ( & self , cursor : & mut ArgCursor ) -> impl Iterator < Item = & OsStr > {
227+ pub fn remaining < ' s > ( & ' s self , cursor : & mut ArgCursor ) -> impl Iterator < Item = & ' s OsStr > {
228228 let remaining = self . items [ cursor. cursor ..] . iter ( ) . map ( |s| s. as_os_str ( ) ) ;
229229 cursor. cursor = self . items . len ( ) ;
230230 remaining
@@ -321,7 +321,7 @@ impl<'s> ParsedArg<'s> {
321321 }
322322
323323 /// Treat as a long-flag
324- pub fn to_long ( & self ) -> Option < ( Result < & str , & OsStr > , Option < & OsStr > ) > {
324+ pub fn to_long ( & self ) -> Option < ( Result < & ' s str , & ' s OsStr > , Option < & ' s OsStr > ) > {
325325 let raw = self . inner ;
326326 let remainder = raw. strip_prefix ( "--" ) ?;
327327 if remainder. is_empty ( ) {
@@ -344,7 +344,7 @@ impl<'s> ParsedArg<'s> {
344344 }
345345
346346 /// Treat as a short-flag
347- pub fn to_short ( & self ) -> Option < ShortFlags < ' _ > > {
347+ pub fn to_short ( & self ) -> Option < ShortFlags < ' s > > {
348348 if let Some ( remainder_os) = self . inner . strip_prefix ( "-" ) {
349349 if remainder_os. starts_with ( "-" ) {
350350 None
@@ -371,7 +371,7 @@ impl<'s> ParsedArg<'s> {
371371 /// **NOTE:** May return a flag or an escape.
372372 ///
373373 /// </div>
374- pub fn to_value_os ( & self ) -> & OsStr {
374+ pub fn to_value_os ( & self ) -> & ' s OsStr {
375375 self . inner
376376 }
377377
@@ -382,14 +382,14 @@ impl<'s> ParsedArg<'s> {
382382 /// **NOTE:** May return a flag or an escape.
383383 ///
384384 /// </div>
385- pub fn to_value ( & self ) -> Result < & str , & OsStr > {
385+ pub fn to_value ( & self ) -> Result < & ' s str , & ' s OsStr > {
386386 self . inner . to_str ( ) . ok_or ( self . inner )
387387 }
388388
389389 /// Safely print an argument that may contain non-UTF8 content
390390 ///
391391 /// This may perform lossy conversion, depending on the platform. If you would like an implementation which escapes the path please use Debug instead.
392- pub fn display ( & self ) -> impl std:: fmt:: Display + ' _ {
392+ pub fn display ( & self ) -> impl std:: fmt:: Display + ' s {
393393 self . inner . to_string_lossy ( )
394394 }
395395}
0 commit comments