Add additional 'new' method to Repo
This commit is contained in:
1 parent
449899b16f
commit
62f8310dea
4 files changed
+22
-9
No files matched your search
@@ -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::*;
|
||||
@@ -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))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user