@@ -280,14 +280,22 @@ impl Drop for URLSearchParamsKeysIterator<'_> {
280
280
}
281
281
}
282
282
283
- impl URLSearchParamsKeysIterator < ' _ > {
283
+ impl < ' a > Iterator for URLSearchParamsKeysIterator < ' a > {
284
+ type Item = & ' a str ;
285
+
286
+ fn next ( & mut self ) -> Option < Self :: Item > {
287
+ self . get_next ( )
288
+ }
289
+ }
290
+
291
+ impl < ' a > URLSearchParamsKeysIterator < ' a > {
284
292
/// Returns true if iterator has a next value.
285
293
pub fn has_next ( & self ) -> bool {
286
294
unsafe { ffi:: ada_search_params_keys_iter_has_next ( self . iterator ) }
287
295
}
288
296
289
297
/// Returns a new value if it's available
290
- pub fn get_next ( & mut self ) -> Option < & str > {
298
+ pub fn get_next ( & mut self ) -> Option < & ' a str > {
291
299
if self . has_next ( ) {
292
300
return None ;
293
301
}
@@ -316,6 +324,14 @@ impl Drop for URLSearchParamsValuesIterator<'_> {
316
324
}
317
325
}
318
326
327
+ impl < ' a > Iterator for URLSearchParamsValuesIterator < ' a > {
328
+ type Item = & ' a str ;
329
+
330
+ fn next ( & mut self ) -> Option < Self :: Item > {
331
+ self . get_next ( )
332
+ }
333
+ }
334
+
319
335
impl < ' a > URLSearchParamsValuesIterator < ' a > {
320
336
fn new (
321
337
iterator : * mut ffi:: ada_url_search_params_values_iter ,
@@ -327,14 +343,14 @@ impl<'a> URLSearchParamsValuesIterator<'a> {
327
343
}
328
344
}
329
345
330
- impl URLSearchParamsValuesIterator < ' _ > {
346
+ impl < ' a > URLSearchParamsValuesIterator < ' a > {
331
347
/// Returns true if iterator has a next value.
332
348
pub fn has_next ( & self ) -> bool {
333
349
unsafe { ffi:: ada_search_params_values_iter_has_next ( self . iterator ) }
334
350
}
335
351
336
352
/// Returns a new value if it's available
337
- pub fn get_next ( & mut self ) -> Option < & str > {
353
+ pub fn get_next ( & mut self ) -> Option < & ' a str > {
338
354
if self . has_next ( ) {
339
355
return None ;
340
356
}
0 commit comments