diff options
author | Colin Walters <walters@verbum.org> | 2022-12-14 20:09:37 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2023-01-26 14:34:32 -0500 |
commit | f913e53c2e3404c2aea8804391a349dca04bfe77 (patch) | |
tree | 97969dfed12c3baffd3b17b1eaf162c7ea725388 /rust-bindings | |
parent | 350809db42eb2577628e965faeb1ac25b360cabf (diff) | |
download | ostree-f913e53c2e3404c2aea8804391a349dca04bfe77.tar.gz |
bindings: Consistently check for `dox` feature
This fixes the build on docs.rs:
https://docs.rs/crate/ostree-ext/0.10.2/builds/699039
```
[INFO] running `Command { std: "docker" "start" "-a" "7d90466f040d987cbcc393bc89f5f0688f052f49e2339c354dd731fdaf0f9667", kill_on_drop: false }`
[INFO] [stderr] Checking ostree v0.17.0
[INFO] [stderr] error[E0063]: missing field `process_passthrough_whiteouts` in initializer of `repo_checkout_at_options::RepoCheckoutAtOptions`
[INFO] [stderr] --> /opt/rustwide/cargo-home/registry/src/github.com-1ecc6299db9ec823/ostree-0.17.0/rust-bindings/src/repo_checkout_at_options/mod.rs:61:9
[INFO] [stderr] |
[INFO] [stderr] 61 | RepoCheckoutAtOptions {
[INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^ missing `process_passthrough_whiteouts`
```
Diffstat (limited to 'rust-bindings')
-rw-r--r-- | rust-bindings/src/repo_checkout_at_options/mod.rs | 66 | ||||
-rw-r--r-- | rust-bindings/tests/repo/checkout_at.rs | 2 | ||||
-rw-r--r-- | rust-bindings/tests/repo/mod.rs | 4 | ||||
-rw-r--r-- | rust-bindings/tests/tests.rs | 2 |
4 files changed, 37 insertions, 37 deletions
diff --git a/rust-bindings/src/repo_checkout_at_options/mod.rs b/rust-bindings/src/repo_checkout_at_options/mod.rs index 099bd229..13223cc4 100644 --- a/rust-bindings/src/repo_checkout_at_options/mod.rs +++ b/rust-bindings/src/repo_checkout_at_options/mod.rs @@ -65,19 +65,19 @@ impl Default for RepoCheckoutAtOptions { enable_fsync: false, process_whiteouts: false, no_copy_fallback: false, - #[cfg(feature = "v2017_6")] + #[cfg(any(feature = "v2017_6", feature = "dox"))] force_copy: false, - #[cfg(feature = "v2017_7")] + #[cfg(any(feature = "v2017_7", feature = "dox"))] bareuseronly_dirs: false, - #[cfg(feature = "v2018_9")] + #[cfg(any(feature = "v2018_9", feature = "dox"))] force_copy_zerosized: false, - #[cfg(feature = "v2022_6")] + #[cfg(any(feature = "v2022_6", feature = "dox"))] process_passthrough_whiteouts: false, subpath: None, devino_to_csum_cache: None, - #[cfg(feature = "v2018_2")] + #[cfg(any(feature = "v2018_2", feature = "dox"))] filter: None, - #[cfg(feature = "v2017_6")] + #[cfg(any(feature = "v2017_6", feature = "dox"))] sepolicy: None, sepolicy_prefix: None, } @@ -114,22 +114,22 @@ impl<'a> ToGlibPtr<'a, *const ffi::OstreeRepoCheckoutAtOptions> for RepoCheckout options.process_whiteouts = self.process_whiteouts.into_glib(); options.no_copy_fallback = self.no_copy_fallback.into_glib(); - #[cfg(feature = "v2017_6")] + #[cfg(any(feature = "v2017_6", feature = "dox"))] { options.force_copy = self.force_copy.into_glib(); } - #[cfg(feature = "v2017_7")] + #[cfg(any(feature = "v2017_7", feature = "dox"))] { options.bareuseronly_dirs = self.bareuseronly_dirs.into_glib(); } - #[cfg(feature = "v2018_9")] + #[cfg(any(feature = "v2018_9", feature = "dox"))] { options.force_copy_zerosized = self.force_copy_zerosized.into_glib(); } - #[cfg(feature = "v2022_6")] + #[cfg(any(feature = "v2022_6", feature = "dox"))] { options.process_passthrough_whiteouts = self.process_passthrough_whiteouts.into_glib(); } @@ -143,16 +143,16 @@ impl<'a> ToGlibPtr<'a, *const ffi::OstreeRepoCheckoutAtOptions> for RepoCheckout let devino_to_csum_cache = self.devino_to_csum_cache.to_glib_none(); options.devino_to_csum_cache = devino_to_csum_cache.0; - #[cfg(feature = "v2017_6")] + #[cfg(any(feature = "v2017_6", feature = "dox"))] let sepolicy = { let sepolicy = self.sepolicy.to_glib_none(); options.sepolicy = sepolicy.0; sepolicy }; - #[cfg(not(feature = "v2017_6"))] + #[cfg(not(any(feature = "v2017_6", feature = "dox")))] let sepolicy = None.to_glib_none(); - #[cfg(feature = "v2018_2")] + #[cfg(any(feature = "v2018_2", feature = "dox"))] { if let Some(filter) = &self.filter { options.filter_user_data = filter.to_glib_none().0; @@ -195,24 +195,24 @@ mod tests { assert_eq!((*ptr).enable_fsync, GFALSE); assert_eq!((*ptr).process_whiteouts, GFALSE); assert_eq!((*ptr).no_copy_fallback, GFALSE); - #[cfg(feature = "v2017_6")] + #[cfg(any(feature = "v2017_6", feature = "dox"))] assert_eq!((*ptr).force_copy, GFALSE); - #[cfg(feature = "v2017_7")] + #[cfg(any(feature = "v2017_7", feature = "dox"))] assert_eq!((*ptr).bareuseronly_dirs, GFALSE); - #[cfg(feature = "v2018_9")] + #[cfg(any(feature = "v2018_9", feature = "dox"))] assert_eq!((*ptr).force_copy_zerosized, GFALSE); - #[cfg(feature = "v2022_6")] + #[cfg(any(feature = "v2022_6", feature = "dox"))] assert_eq!((*ptr).process_passthrough_whiteouts, GFALSE); assert_eq!((*ptr).unused_bools, [GFALSE; 3]); assert_eq!((*ptr).subpath, ptr::null()); assert_eq!((*ptr).devino_to_csum_cache, ptr::null_mut()); assert_eq!((*ptr).unused_ints, [0; 6]); assert_eq!((*ptr).unused_ptrs, [ptr::null_mut(); 3]); - #[cfg(feature = "v2018_2")] + #[cfg(any(feature = "v2018_2", feature = "dox"))] assert_eq!((*ptr).filter, None); - #[cfg(feature = "v2018_2")] + #[cfg(any(feature = "v2018_2", feature = "dox"))] assert_eq!((*ptr).filter_user_data, ptr::null_mut()); - #[cfg(feature = "v2017_6")] + #[cfg(any(feature = "v2017_6", feature = "dox"))] assert_eq!((*ptr).sepolicy, ptr::null_mut()); assert_eq!((*ptr).sepolicy_prefix, ptr::null()); } @@ -227,21 +227,21 @@ mod tests { enable_fsync: true, process_whiteouts: true, no_copy_fallback: true, - #[cfg(feature = "v2017_6")] + #[cfg(any(feature = "v2017_6", feature = "dox"))] force_copy: true, - #[cfg(feature = "v2017_7")] + #[cfg(any(feature = "v2017_7", feature = "dox"))] bareuseronly_dirs: true, - #[cfg(feature = "v2018_9")] + #[cfg(any(feature = "v2018_9", feature = "dox"))] force_copy_zerosized: true, - #[cfg(feature = "v2022_6")] + #[cfg(any(feature = "v2022_6", feature = "dox"))] process_passthrough_whiteouts: true, subpath: Some("sub/path".into()), devino_to_csum_cache: Some(RepoDevInoCache::new()), - #[cfg(feature = "v2018_2")] + #[cfg(any(feature = "v2018_2", feature = "dox"))] filter: RepoCheckoutFilter::new(|_repo, _path, _stat| { crate::RepoCheckoutFilterResult::Skip }), - #[cfg(feature = "v2017_6")] + #[cfg(any(feature = "v2017_6", feature = "dox"))] sepolicy: Some( SePolicy::new(&gio::File::for_path("a/b"), gio::Cancellable::NONE).unwrap(), ), @@ -259,13 +259,13 @@ mod tests { assert_eq!((*ptr).enable_fsync, GTRUE); assert_eq!((*ptr).process_whiteouts, GTRUE); assert_eq!((*ptr).no_copy_fallback, GTRUE); - #[cfg(feature = "v2017_6")] + #[cfg(any(feature = "v2017_6", feature = "dox"))] assert_eq!((*ptr).force_copy, GTRUE); - #[cfg(feature = "v2017_7")] + #[cfg(any(feature = "v2017_7", feature = "dox"))] assert_eq!((*ptr).bareuseronly_dirs, GTRUE); - #[cfg(feature = "v2018_9")] + #[cfg(any(feature = "v2018_9", feature = "dox"))] assert_eq!((*ptr).force_copy_zerosized, GTRUE); - #[cfg(feature = "v2022_6")] + #[cfg(any(feature = "v2022_6", feature = "dox"))] assert_eq!((*ptr).process_passthrough_whiteouts, GTRUE); assert_eq!((*ptr).unused_bools, [GFALSE; 3]); assert_eq!( @@ -278,14 +278,14 @@ mod tests { ); assert_eq!((*ptr).unused_ints, [0; 6]); assert_eq!((*ptr).unused_ptrs, [ptr::null_mut(); 3]); - #[cfg(feature = "v2018_2")] + #[cfg(any(feature = "v2018_2", feature = "dox"))] assert!((*ptr).filter == Some(repo_checkout_filter::filter_trampoline_unwindsafe)); - #[cfg(feature = "v2018_2")] + #[cfg(any(feature = "v2018_2", feature = "dox"))] assert_eq!( (*ptr).filter_user_data, options.filter.as_ref().unwrap().to_glib_none().0, ); - #[cfg(feature = "v2017_6")] + #[cfg(any(feature = "v2017_6", feature = "dox"))] assert_eq!((*ptr).sepolicy, options.sepolicy.to_glib_none().0); assert_eq!( CStr::from_ptr((*ptr).sepolicy_prefix), diff --git a/rust-bindings/tests/repo/checkout_at.rs b/rust-bindings/tests/repo/checkout_at.rs index 5c07b992..0c79b428 100644 --- a/rust-bindings/tests/repo/checkout_at.rs +++ b/rust-bindings/tests/repo/checkout_at.rs @@ -74,7 +74,7 @@ fn should_checkout_at_with_options() { } #[test] -#[cfg(feature = "v2018_2")] +#[cfg(any(feature = "v2018_2", feature = "dox"))] fn should_checkout_at_with_filter() { use std::path::Path; diff --git a/rust-bindings/tests/repo/mod.rs b/rust-bindings/tests/repo/mod.rs index 54ee7ac0..a8d2b9d0 100644 --- a/rust-bindings/tests/repo/mod.rs +++ b/rust-bindings/tests/repo/mod.rs @@ -2,7 +2,7 @@ use crate::util::*; use ostree::prelude::*; use ostree::{ObjectName, ObjectType}; -#[cfg(feature = "v2016_8")] +#[cfg(any(feature = "v2016_8", feature = "dox"))] mod checkout_at; mod generate_static; @@ -178,7 +178,7 @@ fn should_write_content_to_repo() { } #[test] -#[cfg(feature = "v2016_4")] +#[cfg(any(feature = "v2016_4", feature = "dox"))] fn repo_file() { use std::os::unix::fs::MetadataExt; let test_repo = TestRepo::new(); diff --git a/rust-bindings/tests/tests.rs b/rust-bindings/tests/tests.rs index 18076002..46e71d76 100644 --- a/rust-bindings/tests/tests.rs +++ b/rust-bindings/tests/tests.rs @@ -1,6 +1,6 @@ mod core; mod functions; mod repo; -#[cfg(feature = "v2020_2")] +#[cfg(any(feature = "v2020_2", feature = "dox"))] mod sign; mod util; |