diff --git a/rust-bindings/rust/conf/ostree.toml b/rust-bindings/rust/conf/ostree.toml index e54a88e4..25d5085c 100644 --- a/rust-bindings/rust/conf/ostree.toml +++ b/rust-bindings/rust/conf/ostree.toml @@ -85,7 +85,6 @@ status = "generate" [[object]] name = "OSTree.Repo" status = "generate" -manual_traits = ["RepoExtManual"] [[object.function]] # crashes while generating, not sure what's wrong with this; might be a gir issue name = "write_metadata_async" diff --git a/rust-bindings/rust/src/lib.rs b/rust-bindings/rust/src/lib.rs index a3270824..7fb6f836 100644 --- a/rust-bindings/rust/src/lib.rs +++ b/rust-bindings/rust/src/lib.rs @@ -35,5 +35,4 @@ mod tests; // prelude pub mod prelude { pub use crate::auto::traits::*; - pub use crate::repo::RepoExtManual; } diff --git a/rust-bindings/rust/src/repo.rs b/rust-bindings/rust/src/repo.rs index 3b493a86..6a7c5933 100644 --- a/rust-bindings/rust/src/repo.rs +++ b/rust-bindings/rust/src/repo.rs @@ -34,38 +34,12 @@ unsafe fn from_glib_container_variant_set(ptr: *mut glib_sys::GHashTable) -> Has set } -pub trait RepoExtManual { - fn new_for_path>(path: P) -> Repo; - - fn traverse_commit>( - &self, - commit_checksum: &str, - maxdepth: i32, - cancellable: Option<&P>, - ) -> Result, Error>; - - // TODO: return GString? - fn list_refs>( - &self, - refspec_prefix: Option<&str>, - cancellable: Option<&P>, - ) -> Result, Error>; - - #[cfg(any(feature = "v2016_4", feature = "dox"))] - fn list_refs_ext>( - &self, - refspec_prefix: Option<&str>, - flags: RepoListRefsExtFlags, - cancellable: Option<&P>, - ) -> Result, Error>; -} - -impl> RepoExtManual for O { - fn new_for_path>(path: P) -> Repo { +impl Repo { + pub fn new_for_path>(path: P) -> Repo { Repo::new(&gio::File::new_for_path(path.as_ref())) } - fn traverse_commit>( + pub fn traverse_commit>( &self, commit_checksum: &str, maxdepth: i32, @@ -75,7 +49,7 @@ impl> RepoExtManual for O { let mut error = ptr::null_mut(); let mut hashtable = ptr::null_mut(); let _ = ostree_sys::ostree_repo_traverse_commit( - self.as_ref().to_glib_none().0, + self.to_glib_none().0, commit_checksum.to_glib_none().0, maxdepth, &mut hashtable, @@ -90,7 +64,7 @@ impl> RepoExtManual for O { } } - fn list_refs>( + pub fn list_refs>( &self, refspec_prefix: Option<&str>, cancellable: Option<&P>, @@ -99,7 +73,7 @@ impl> RepoExtManual for O { let mut error = ptr::null_mut(); let mut hashtable = ptr::null_mut(); let _ = ostree_sys::ostree_repo_list_refs( - self.as_ref().to_glib_none().0, + self.to_glib_none().0, refspec_prefix.to_glib_none().0, &mut hashtable, cancellable.map(|p| p.as_ref()).to_glib_none().0, @@ -115,7 +89,7 @@ impl> RepoExtManual for O { } #[cfg(any(feature = "v2016_4", feature = "dox"))] - fn list_refs_ext>( + pub fn list_refs_ext>( &self, refspec_prefix: Option<&str>, flags: RepoListRefsExtFlags, @@ -125,7 +99,7 @@ impl> RepoExtManual for O { let mut error = ptr::null_mut(); let mut hashtable = ptr::null_mut(); let _ = ostree_sys::ostree_repo_list_refs_ext( - self.as_ref().to_glib_none().0, + self.to_glib_none().0, refspec_prefix.to_glib_none().0, &mut hashtable, flags.to_glib(),