Skip to content

Commit 7cc03ee

Browse files
committed
gio: Don't require a 'static &str in File::enumerate_children_async() and enumerate_children_future()
Fixes #942
1 parent cc1f50b commit 7cc03ee

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

gio/src/file.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ pub trait FileExtManual: Sized {
200200
Q: FnOnce(Result<FileEnumerator, glib::Error>) + 'static,
201201
>(
202202
&self,
203-
attributes: &'static str,
203+
attributes: &str,
204204
flags: FileQueryInfoFlags,
205205
io_priority: glib::Priority,
206206
cancellable: Option<&P>,
@@ -209,7 +209,7 @@ pub trait FileExtManual: Sized {
209209

210210
fn enumerate_children_future(
211211
&self,
212-
attributes: &'static str,
212+
attributes: &str,
213213
flags: FileQueryInfoFlags,
214214
io_priority: glib::Priority,
215215
) -> Pin<Box<dyn std::future::Future<Output = Result<FileEnumerator, glib::Error>> + 'static>>;
@@ -432,7 +432,7 @@ impl<O: IsA<File>> FileExtManual for O {
432432
Q: FnOnce(Result<FileEnumerator, glib::Error>) + 'static,
433433
>(
434434
&self,
435-
attributes: &'static str,
435+
attributes: &str,
436436
flags: FileQueryInfoFlags,
437437
io_priority: glib::Priority,
438438
cancellable: Option<&P>,
@@ -486,16 +486,17 @@ impl<O: IsA<File>> FileExtManual for O {
486486

487487
fn enumerate_children_future(
488488
&self,
489-
attributes: &'static str,
489+
attributes: &str,
490490
flags: FileQueryInfoFlags,
491491
io_priority: glib::Priority,
492492
) -> Pin<Box<dyn std::future::Future<Output = Result<FileEnumerator, glib::Error>> + 'static>>
493493
{
494+
let attributes = attributes.to_owned();
494495
Box::pin(crate::GioFuture::new(
495496
self,
496497
move |obj, cancellable, send| {
497498
obj.enumerate_children_async(
498-
attributes,
499+
&attributes,
499500
flags,
500501
io_priority,
501502
Some(cancellable),

0 commit comments

Comments
 (0)