Add additional 'new' method to Repo

This commit is contained in:
Felix Krull authored and Colin Walters committed 2022-05-06 12:53:53 -04:00
1 parent 449899b16f
commit 62f8310dea
4 files changed
+22 -9

No files matched your search

+6 -2
View File
@@ -13,6 +13,10 @@ use glib::Error;
mod auto;
pub use auto::*;
mod repo;
// public modules
pub mod prelude;
pub use prelude::*;
pub mod prelude {
pub use auto::traits::*;
pub use repo::RepoExtManual;
}
@@ -1 +0,0 @@
pub use traits::*;
+15
View File
@@ -0,0 +1,15 @@
use auto::Repo;
use gio;
use glib;
use glib::IsA;
pub trait RepoExtManual {
fn new_for_str(path: &str) -> Repo;
}
impl<O: IsA<Repo> + IsA<glib::Object> + Clone + 'static> RepoExtManual for O {
fn new_for_str(path: &str) -> Repo {
Repo::new(&gio::File::new_for_path(path))
}
}