diff --git a/rust-bindings/rust/src/collection_ref/mod.rs b/rust-bindings/rust/src/collection_ref.rs similarity index 98% rename from rust-bindings/rust/src/collection_ref/mod.rs rename to rust-bindings/rust/src/collection_ref.rs index 35ea396b..c99542ea 100644 --- a/rust-bindings/rust/src/collection_ref/mod.rs +++ b/rust-bindings/rust/src/collection_ref.rs @@ -71,6 +71,3 @@ impl hash::Hash for CollectionRef { hash::Hash::hash(&self.hash(), state) } } - -#[cfg(test)] -mod tests; diff --git a/rust-bindings/rust/src/lib.rs b/rust-bindings/rust/src/lib.rs index 6344ed15..5ac6af24 100644 --- a/rust-bindings/rust/src/lib.rs +++ b/rust-bindings/rust/src/lib.rs @@ -13,22 +13,25 @@ extern crate lazy_static; use glib::Error; -// re-exports +// code generated by gir mod auto; pub use crate::auto::functions::*; pub use crate::auto::*; -mod repo; - +// handwritten code #[cfg(any(feature = "v2018_6", feature = "dox"))] mod collection_ref; +mod repo; #[cfg(any(feature = "v2018_6", feature = "dox"))] -pub use crate::collection_ref::CollectionRef; - +pub use crate::collection_ref::*; mod object_name; -pub use crate::object_name::ObjectName; +pub use crate::object_name::*; -// public modules +// tests +#[cfg(test)] +mod tests; + +// prelude pub mod prelude { pub use crate::auto::traits::*; pub use crate::repo::RepoExtManual; diff --git a/rust-bindings/rust/src/repo/mod.rs b/rust-bindings/rust/src/repo.rs similarity index 99% rename from rust-bindings/rust/src/repo/mod.rs rename to rust-bindings/rust/src/repo.rs index 220372e3..3b493a86 100644 --- a/rust-bindings/rust/src/repo/mod.rs +++ b/rust-bindings/rust/src/repo.rs @@ -141,6 +141,3 @@ impl> RepoExtManual for O { } } } - -#[cfg(test)] -mod tests; diff --git a/rust-bindings/rust/src/collection_ref/tests.rs b/rust-bindings/rust/src/tests/collection_ref.rs similarity index 98% rename from rust-bindings/rust/src/collection_ref/tests.rs rename to rust-bindings/rust/src/tests/collection_ref.rs index 5dc72deb..9db3177a 100644 --- a/rust-bindings/rust/src/collection_ref/tests.rs +++ b/rust-bindings/rust/src/tests/collection_ref.rs @@ -1,4 +1,4 @@ -use super::*; +use crate::CollectionRef; use std::collections::hash_map::DefaultHasher; use std::hash::{Hash, Hasher}; diff --git a/rust-bindings/rust/src/tests/mod.rs b/rust-bindings/rust/src/tests/mod.rs new file mode 100644 index 00000000..6726a27e --- /dev/null +++ b/rust-bindings/rust/src/tests/mod.rs @@ -0,0 +1,2 @@ +mod collection_ref; +mod repo; diff --git a/rust-bindings/rust/src/repo/tests.rs b/rust-bindings/rust/src/tests/repo.rs similarity index 94% rename from rust-bindings/rust/src/repo/tests.rs rename to rust-bindings/rust/src/tests/repo.rs index de388120..59a6792d 100644 --- a/rust-bindings/rust/src/repo/tests.rs +++ b/rust-bindings/rust/src/tests/repo.rs @@ -1,4 +1,4 @@ -use super::*; +use crate::Repo; use crate::RepoMode; #[test] @@ -11,4 +11,4 @@ fn should_get_repo_mode_from_string() { fn should_return_error_for_invalid_repo_mode_string() { let result = Repo::mode_from_string("invalid-repo-mode"); assert!(result.is_err()); -} \ No newline at end of file +}