doc_target_path = "../target/vendor.md"
deprecate_by_min_version = true
single_version_file = true
+trust_return_value_nullability = true
generate_display_trait = true
girs_directories = [ "../gir-files" ]
#[doc(alias = "ostree_bootconfig_parser_clone")]
#[must_use]
- pub fn clone(&self) -> Option<BootconfigParser> {
+ pub fn clone(&self) -> BootconfigParser {
unsafe {
from_glib_full(ffi::ostree_bootconfig_parser_clone(self.to_glib_none().0))
}
impl CollectionRef {
#[doc(alias = "ostree_collection_ref_new")]
- pub fn new(collection_id: Option<&str>, ref_name: &str) -> Option<CollectionRef> {
+ pub fn new(collection_id: Option<&str>, ref_name: &str) -> CollectionRef {
unsafe {
from_glib_full(ffi::ostree_collection_ref_new(collection_id.to_glib_none().0, ref_name.to_glib_none().0))
}
#[doc(alias = "ostree_deployment_clone")]
#[must_use]
- pub fn clone(&self) -> Option<Deployment> {
+ pub fn clone(&self) -> Deployment {
unsafe {
from_glib_full(ffi::ostree_deployment_clone(self.to_glib_none().0))
}
#[doc(alias = "ostree_deployment_get_bootcsum")]
#[doc(alias = "get_bootcsum")]
- pub fn bootcsum(&self) -> Option<glib::GString> {
+ pub fn bootcsum(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_deployment_get_bootcsum(self.to_glib_none().0))
}
#[doc(alias = "ostree_deployment_get_csum")]
#[doc(alias = "get_csum")]
- pub fn csum(&self) -> Option<glib::GString> {
+ pub fn csum(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_deployment_get_csum(self.to_glib_none().0))
}
#[doc(alias = "ostree_deployment_get_origin_relpath")]
#[doc(alias = "get_origin_relpath")]
- pub fn origin_relpath(&self) -> Option<glib::GString> {
+ pub fn origin_relpath(&self) -> glib::GString {
unsafe {
from_glib_full(ffi::ostree_deployment_get_origin_relpath(self.to_glib_none().0))
}
#[doc(alias = "ostree_deployment_get_osname")]
#[doc(alias = "get_osname")]
- pub fn osname(&self) -> Option<glib::GString> {
+ pub fn osname(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_deployment_get_osname(self.to_glib_none().0))
}
#[cfg(any(feature = "v2016_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))]
#[doc(alias = "ostree_deployment_unlocked_state_to_string")]
- pub fn unlocked_state_to_string(state: DeploymentUnlockedState) -> Option<glib::GString> {
+ pub fn unlocked_state_to_string(state: DeploymentUnlockedState) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_deployment_unlocked_state_to_string(state.into_glib()))
}
//}
#[doc(alias = "ostree_checksum_from_bytes_v")]
-pub fn checksum_from_bytes_v(csum_v: &glib::Variant) -> Option<glib::GString> {
+pub fn checksum_from_bytes_v(csum_v: &glib::Variant) -> glib::GString {
unsafe {
from_glib_full(ffi::ostree_checksum_from_bytes_v(csum_v.to_glib_none().0))
}
}
#[doc(alias = "ostree_checksum_to_bytes_v")]
-pub fn checksum_to_bytes_v(checksum: &str) -> Option<glib::Variant> {
+pub fn checksum_to_bytes_v(checksum: &str) -> glib::Variant {
unsafe {
from_glib_full(ffi::ostree_checksum_to_bytes_v(checksum.to_glib_none().0))
}
}
#[doc(alias = "ostree_commit_get_parent")]
-pub fn commit_get_parent(commit_variant: &glib::Variant) -> Option<glib::GString> {
+pub fn commit_get_parent(commit_variant: &glib::Variant) -> glib::GString {
unsafe {
from_glib_full(ffi::ostree_commit_get_parent(commit_variant.to_glib_none().0))
}
}
#[doc(alias = "ostree_create_directory_metadata")]
-pub fn create_directory_metadata(dir_info: &gio::FileInfo, xattrs: Option<&glib::Variant>) -> Option<glib::Variant> {
+pub fn create_directory_metadata(dir_info: &gio::FileInfo, xattrs: Option<&glib::Variant>) -> glib::Variant {
unsafe {
from_glib_full(ffi::ostree_create_directory_metadata(dir_info.to_glib_none().0, xattrs.to_glib_none().0))
}
}
#[doc(alias = "ostree_metadata_variant_type")]
-pub fn metadata_variant_type(objtype: ObjectType) -> Option<glib::VariantType> {
+pub fn metadata_variant_type(objtype: ObjectType) -> glib::VariantType {
unsafe {
from_glib_none(ffi::ostree_metadata_variant_type(objtype.into_glib()))
}
}
#[doc(alias = "ostree_object_name_serialize")]
-pub fn object_name_serialize(checksum: &str, objtype: ObjectType) -> Option<glib::Variant> {
+pub fn object_name_serialize(checksum: &str, objtype: ObjectType) -> glib::Variant {
unsafe {
from_glib_none(ffi::ostree_object_name_serialize(checksum.to_glib_none().0, objtype.into_glib()))
}
}
#[doc(alias = "ostree_object_to_string")]
-pub fn object_to_string(checksum: &str, objtype: ObjectType) -> Option<glib::GString> {
+pub fn object_to_string(checksum: &str, objtype: ObjectType) -> glib::GString {
unsafe {
from_glib_full(ffi::ostree_object_to_string(checksum.to_glib_none().0, objtype.into_glib()))
}
}
#[doc(alias = "ostree_object_type_to_string")]
-pub fn object_type_to_string(objtype: ObjectType) -> Option<glib::GString> {
+pub fn object_type_to_string(objtype: ObjectType) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_object_type_to_string(objtype.into_glib()))
}
}
//#[doc(alias = "ostree_gpg_verify_result_get")]
- //pub fn get(&self, signature_index: u32, attrs: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 29 }) -> Option<glib::Variant> {
+ //pub fn get(&self, signature_index: u32, attrs: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 29 }) -> glib::Variant {
// unsafe { TODO: call ffi:ostree_gpg_verify_result_get() }
//}
#[doc(alias = "ostree_gpg_verify_result_get_all")]
#[doc(alias = "get_all")]
- pub fn all(&self, signature_index: u32) -> Option<glib::Variant> {
+ pub fn all(&self, signature_index: u32) -> glib::Variant {
unsafe {
from_glib_none(ffi::ostree_gpg_verify_result_get_all(self.to_glib_none().0, signature_index))
}
#[doc(alias = "ostree_mutable_tree_get_contents_checksum")]
#[doc(alias = "get_contents_checksum")]
- pub fn contents_checksum(&self) -> Option<glib::GString> {
+ pub fn contents_checksum(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_mutable_tree_get_contents_checksum(self.to_glib_none().0))
}
#[doc(alias = "ostree_mutable_tree_get_metadata_checksum")]
#[doc(alias = "get_metadata_checksum")]
- pub fn metadata_checksum(&self) -> Option<glib::GString> {
+ pub fn metadata_checksum(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_mutable_tree_get_metadata_checksum(self.to_glib_none().0))
}
// DO NOT EDIT
use glib::translate::*;
+use std::fmt;
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
impl Remote {
#[doc(alias = "ostree_remote_get_name")]
#[doc(alias = "get_name")]
- pub fn name(&self) -> Option<glib::GString> {
+ pub fn name(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_remote_get_name(self.to_glib_none().0))
}
#[doc(alias = "ostree_remote_get_url")]
#[doc(alias = "get_url")]
- pub fn url(&self) -> Option<glib::GString> {
+ pub fn url(&self) -> glib::GString {
unsafe {
from_glib_full(ffi::ostree_remote_get_url(self.to_glib_none().0))
}
}
}
+
+impl fmt::Display for Remote {
+ #[inline]
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ f.write_str(&self.name())
+ }
+}
}
#[doc(alias = "ostree_repo_copy_config")]
- pub fn copy_config(&self) -> Option<glib::KeyFile> {
+ pub fn copy_config(&self) -> glib::KeyFile {
unsafe {
from_glib_full(ffi::ostree_repo_copy_config(self.to_glib_none().0))
}
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_2")))]
#[doc(alias = "ostree_repo_get_bootloader")]
#[doc(alias = "get_bootloader")]
- pub fn bootloader(&self) -> Option<glib::GString> {
+ pub fn bootloader(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_repo_get_bootloader(self.to_glib_none().0))
}
#[doc(alias = "ostree_repo_get_config")]
#[doc(alias = "get_config")]
- pub fn config(&self) -> Option<glib::KeyFile> {
+ pub fn config(&self) -> glib::KeyFile {
unsafe {
from_glib_none(ffi::ostree_repo_get_config(self.to_glib_none().0))
}
#[doc(alias = "ostree_repo_get_path")]
#[doc(alias = "get_path")]
- pub fn path(&self) -> Option<gio::File> {
+ pub fn path(&self) -> gio::File {
unsafe {
from_glib_none(ffi::ostree_repo_get_path(self.to_glib_none().0))
}
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))]
#[doc(alias = "ostree_repo_get_remote_option")]
#[doc(alias = "get_remote_option")]
- pub fn remote_option(&self, remote_name: &str, option_name: &str, default_value: Option<&str>) -> Result<glib::GString, glib::Error> {
+ pub fn remote_option(&self, remote_name: &str, option_name: &str, default_value: Option<&str>) -> Result<Option<glib::GString>, glib::Error> {
unsafe {
let mut out_value = ptr::null_mut();
let mut error = ptr::null_mut();
#[cfg(any(feature = "v2020_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_8")))]
#[doc(alias = "ostree_repo_gpg_sign_data")]
- pub fn gpg_sign_data(&self, data: &glib::Bytes, old_signatures: &glib::Bytes, key_id: &[&str], homedir: Option<&str>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<glib::Bytes, glib::Error> {
+ pub fn gpg_sign_data(&self, data: &glib::Bytes, old_signatures: Option<&glib::Bytes>, key_id: &[&str], homedir: Option<&str>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<glib::Bytes, glib::Error> {
unsafe {
let mut out_signatures = ptr::null_mut();
let mut error = ptr::null_mut();
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
#[doc(alias = "ostree_repo_signature_verify_commit_data")]
- pub fn signature_verify_commit_data(&self, remote_name: &str, commit_data: &glib::Bytes, commit_metadata: &glib::Bytes, flags: RepoVerifyFlags) -> Result<Option<glib::GString>, glib::Error> {
+ pub fn signature_verify_commit_data(&self, remote_name: &str, commit_data: &glib::Bytes, commit_metadata: &glib::Bytes, flags: RepoVerifyFlags) -> Result<glib::GString, glib::Error> {
unsafe {
let mut out_results = ptr::null_mut();
let mut error = ptr::null_mut();
#[doc(alias = "ostree_repo_file_get_checksum")]
#[doc(alias = "get_checksum")]
- pub fn checksum(&self) -> Option<glib::GString> {
+ pub fn checksum(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_repo_file_get_checksum(self.to_glib_none().0))
}
#[doc(alias = "ostree_repo_file_get_repo")]
#[doc(alias = "get_repo")]
- pub fn repo(&self) -> Option<Repo> {
+ pub fn repo(&self) -> Repo {
unsafe {
from_glib_none(ffi::ostree_repo_file_get_repo(self.to_glib_none().0))
}
#[doc(alias = "ostree_repo_file_get_root")]
#[doc(alias = "get_root")]
#[must_use]
- pub fn root(&self) -> Option<RepoFile> {
+ pub fn root(&self) -> RepoFile {
unsafe {
from_glib_none(ffi::ostree_repo_file_get_root(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_repo_file_tree_get_contents")]
- pub fn tree_get_contents(&self) -> Option<glib::Variant> {
+ pub fn tree_get_contents(&self) -> glib::Variant {
unsafe {
from_glib_full(ffi::ostree_repo_file_tree_get_contents(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_repo_file_tree_get_contents_checksum")]
- pub fn tree_get_contents_checksum(&self) -> Option<glib::GString> {
+ pub fn tree_get_contents_checksum(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_repo_file_tree_get_contents_checksum(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_repo_file_tree_get_metadata")]
- pub fn tree_get_metadata(&self) -> Option<glib::Variant> {
+ pub fn tree_get_metadata(&self) -> glib::Variant {
unsafe {
from_glib_full(ffi::ostree_repo_file_tree_get_metadata(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_repo_file_tree_get_metadata_checksum")]
- pub fn tree_get_metadata_checksum(&self) -> Option<glib::GString> {
+ pub fn tree_get_metadata_checksum(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_repo_file_tree_get_metadata_checksum(self.to_glib_none().0))
}
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))]
#[doc(alias = "ostree_sepolicy_get_csum")]
#[doc(alias = "get_csum")]
- pub fn csum(&self) -> Option<glib::GString> {
+ pub fn csum(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_sepolicy_get_csum(self.to_glib_none().0))
}
#[doc(alias = "ostree_sepolicy_get_label")]
#[doc(alias = "get_label")]
- pub fn label(&self, relpath: &str, unix_mode: u32, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<glib::GString, glib::Error> {
+ pub fn label(&self, relpath: &str, unix_mode: u32, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<Option<glib::GString>, glib::Error> {
unsafe {
let mut out_label = ptr::null_mut();
let mut error = ptr::null_mut();
#[doc(alias = "ostree_sepolicy_get_name")]
#[doc(alias = "get_name")]
- pub fn name(&self) -> Option<glib::GString> {
+ pub fn name(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_sepolicy_get_name(self.to_glib_none().0))
}
#[doc(alias = "ostree_sepolicy_get_path")]
#[doc(alias = "get_path")]
- pub fn path(&self) -> Option<gio::File> {
+ pub fn path(&self) -> gio::File {
unsafe {
from_glib_none(ffi::ostree_sepolicy_get_path(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_sepolicy_restorecon")]
- pub fn restorecon(&self, path: &str, info: Option<&gio::FileInfo>, target: &impl IsA<gio::File>, flags: SePolicyRestoreconFlags, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<glib::GString, glib::Error> {
+ pub fn restorecon(&self, path: &str, info: Option<&gio::FileInfo>, target: &impl IsA<gio::File>, flags: SePolicyRestoreconFlags, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<Option<glib::GString>, glib::Error> {
unsafe {
let mut out_new_label = ptr::null_mut();
let mut error = ptr::null_mut();
}
}
-unsafe impl Send for SePolicy {}
-
impl fmt::Display for SePolicy {
+ #[inline]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- f.write_str("SePolicy")
+ f.write_str(&self.name())
}
}
+
+unsafe impl Send for SePolicy {}
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_get_name")]
#[doc(alias = "get_name")]
- fn name(&self) -> Option<glib::GString>;
+ fn name(&self) -> glib::GString;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_metadata_format")]
- fn metadata_format(&self) -> Option<glib::GString>;
+ fn metadata_format(&self) -> glib::GString;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[doc(alias = "ostree_sign_metadata_key")]
- fn metadata_key(&self) -> Option<glib::GString>;
+ fn metadata_key(&self) -> glib::GString;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
- fn name(&self) -> Option<glib::GString> {
+ fn name(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_sign_get_name(self.as_ref().to_glib_none().0))
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
- fn metadata_format(&self) -> Option<glib::GString> {
+ fn metadata_format(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_sign_metadata_format(self.as_ref().to_glib_none().0))
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
- fn metadata_key(&self) -> Option<glib::GString> {
+ fn metadata_key(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::ostree_sign_metadata_key(self.as_ref().to_glib_none().0))
}
#[doc(alias = "ostree_sysroot_get_deployment_directory")]
#[doc(alias = "get_deployment_directory")]
- pub fn deployment_directory(&self, deployment: &Deployment) -> Option<gio::File> {
+ pub fn deployment_directory(&self, deployment: &Deployment) -> gio::File {
unsafe {
from_glib_full(ffi::ostree_sysroot_get_deployment_directory(self.to_glib_none().0, deployment.to_glib_none().0))
}
#[doc(alias = "ostree_sysroot_get_deployment_dirpath")]
#[doc(alias = "get_deployment_dirpath")]
- pub fn deployment_dirpath(&self, deployment: &Deployment) -> Option<glib::GString> {
+ pub fn deployment_dirpath(&self, deployment: &Deployment) -> glib::GString {
unsafe {
from_glib_full(ffi::ostree_sysroot_get_deployment_dirpath(self.to_glib_none().0, deployment.to_glib_none().0))
}
#[doc(alias = "ostree_sysroot_get_path")]
#[doc(alias = "get_path")]
- pub fn path(&self) -> Option<gio::File> {
+ pub fn path(&self) -> gio::File {
unsafe {
from_glib_none(ffi::ostree_sysroot_get_path(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_sysroot_origin_new_from_refspec")]
- pub fn origin_new_from_refspec(&self, refspec: &str) -> Option<glib::KeyFile> {
+ pub fn origin_new_from_refspec(&self, refspec: &str) -> glib::KeyFile {
unsafe {
from_glib_full(ffi::ostree_sysroot_origin_new_from_refspec(self.to_glib_none().0, refspec.to_glib_none().0))
}
#[cfg(any(feature = "v2017_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))]
#[doc(alias = "ostree_sysroot_repo")]
- pub fn repo(&self) -> Option<Repo> {
+ pub fn repo(&self) -> Repo {
unsafe {
from_glib_none(ffi::ostree_sysroot_repo(self.to_glib_none().0))
}
#[doc(alias = "ostree_sysroot_get_deployment_origin_path")]
#[doc(alias = "get_deployment_origin_path")]
- pub fn deployment_origin_path(deployment_path: &impl IsA<gio::File>) -> Option<gio::File> {
+ pub fn deployment_origin_path(deployment_path: &impl IsA<gio::File>) -> gio::File {
unsafe {
from_glib_full(ffi::ostree_sysroot_get_deployment_origin_path(deployment_path.as_ref().to_glib_none().0))
}
Generated by gir (https://github.com/gtk-rs/gir @ 0eeebbdf9d4d)
-from gir-files (@ be0dbf02d770)
+from gir-files (@ f4ba299323ae)
#[test]
fn should_get_collection_id() {
- let collection_ref = CollectionRef::new(Some("collection.id"), "ref").unwrap();
+ let collection_ref = CollectionRef::new(Some("collection.id"), "ref");
let id = collection_ref.collection_id().unwrap().to_str().unwrap();
assert_eq!(id, "collection.id");
#[test]
fn should_get_none_collection_id() {
- let collection_ref = CollectionRef::new(None, "ref").unwrap();
+ let collection_ref = CollectionRef::new(None, "ref");
let id = collection_ref.collection_id();
assert_eq!(id, None);
#[test]
fn should_get_ref_name() {
- let collection_ref = CollectionRef::new(Some("collection.id"), "ref-name").unwrap();
+ let collection_ref = CollectionRef::new(Some("collection.id"), "ref-name");
let ref_name = collection_ref.ref_name().to_str().unwrap();
assert_eq!(ref_name, "ref-name");
/// Create a new `ObjectName` with the given checksum and `ObjectType`.
pub fn new<S: Into<GString>>(checksum: S, object_type: ObjectType) -> ObjectName {
let checksum = checksum.into();
- let variant = object_name_serialize(checksum.as_str(), object_type)
- .expect("type checks should make this safe");
+ let variant = object_name_serialize(checksum.as_str(), object_type);
ObjectName {
variant,
checksum,
/// Format this `ObjectName` as a string.
fn to_string(&self) -> GString {
object_to_string(self.checksum(), self.object_type())
- .expect("type checks should make this safe")
}
}
assert_eq!(sysroot.subbootversion(), 0);
sysroot.cleanup(gio::Cancellable::NONE).unwrap();
- sysroot.path().unwrap()
+ sysroot.path()
};
let path_loaded = {
let tmp_path = Some(tmpdir.path().to_path_buf());
assert_eq!(sysroot.subbootversion(), 0);
sysroot.cleanup(gio::Cancellable::NONE).unwrap();
- sysroot.path().unwrap()
+ sysroot.path()
};
assert_eq!(path_created.to_string(), path_loaded.to_string());
}
#[test]
fn same_value_should_be_equal() {
- let r = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
+ let r = CollectionRef::new(Some("io.gitlab.fkrull"), "ref");
assert_eq!(r, r);
}
#[test]
fn equal_values_should_be_equal() {
- let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
- let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
+ let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref");
+ let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref");
assert_eq!(a, b);
}
#[test]
fn equal_values_without_collection_id_should_be_equal() {
- let a = CollectionRef::new(None, "ref-name").unwrap();
- let b = CollectionRef::new(None, "ref-name").unwrap();
+ let a = CollectionRef::new(None, "ref-name");
+ let b = CollectionRef::new(None, "ref-name");
assert_eq!(a, b);
}
#[test]
fn different_values_should_not_be_equal() {
- let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref1").unwrap();
- let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref2").unwrap();
+ let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref1");
+ let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref2");
assert_ne!(a, b);
}
-#[test]
-fn new_with_invalid_collection_id_should_return_none() {
- let r = CollectionRef::new(Some(".abc"), "ref");
- assert_eq!(r, None);
-}
-
#[test]
fn hash_for_equal_values_should_be_equal() {
- let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
- let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
+ let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref");
+ let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref");
assert_eq!(hash(&a), hash(&b));
}
#[test]
fn hash_for_values_with_different_collection_id_should_be_different() {
- let a = CollectionRef::new(Some("io.gitlab.fkrull1"), "ref").unwrap();
- let b = CollectionRef::new(Some("io.gitlab.fkrull2"), "ref").unwrap();
+ let a = CollectionRef::new(Some("io.gitlab.fkrull1"), "ref");
+ let b = CollectionRef::new(Some("io.gitlab.fkrull2"), "ref");
assert_ne!(hash(&a), hash(&b));
}
#[test]
fn hash_for_values_with_different_ref_id_should_be_different() {
- let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref-1").unwrap();
- let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref-2").unwrap();
+ let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref-1");
+ let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref-2");
assert_ne!(hash(&a), hash(&b));
}
#[test]
fn hash_should_be_different_if_collection_id_is_absent() {
- let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
- let b = CollectionRef::new(None, "ref").unwrap();
+ let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref");
+ let b = CollectionRef::new(None, "ref");
assert_ne!(hash(&a), hash(&b));
}
#[test]
fn clone_should_be_equal_to_original_value() {
- let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
+ let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref");
let b = a.clone();
assert_eq!(a, b);
}
Generated by gir (https://github.com/gtk-rs/gir @ 0eeebbdf9d4d)
-from gir-files (@ be0dbf02d770)
+from gir-files (@ f4ba299323ae)
pub fn ostree_collection_ref_dup(ref_: *const OstreeCollectionRef) -> *mut OstreeCollectionRef;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
+ pub fn ostree_collection_ref_equal(ref1: gconstpointer, ref2: gconstpointer) -> gboolean;
+ #[cfg(any(feature = "v2018_6", feature = "dox"))]
+ #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
pub fn ostree_collection_ref_free(ref_: *mut OstreeCollectionRef);
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
+ pub fn ostree_collection_ref_hash(ref_: gconstpointer) -> c_uint;
+ #[cfg(any(feature = "v2018_6", feature = "dox"))]
+ #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
pub fn ostree_collection_ref_dupv(
refs: *const *const OstreeCollectionRef,
) -> *mut *mut OstreeCollectionRef;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
- pub fn ostree_collection_ref_equal(ref1: gconstpointer, ref2: gconstpointer) -> gboolean;
- #[cfg(any(feature = "v2018_6", feature = "dox"))]
- #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
pub fn ostree_collection_ref_freev(refs: *mut *mut OstreeCollectionRef);
- #[cfg(any(feature = "v2018_6", feature = "dox"))]
- #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
- pub fn ostree_collection_ref_hash(ref_: gconstpointer) -> c_uint;
//=========================================================================
// OstreeCommitSizesEntry
#[test]
fn sign_api_should_work() {
let dummy_sign = ostree::Sign::by_name("dummy").unwrap();
- assert_eq!(dummy_sign.name().unwrap(), "dummy");
+ assert_eq!(dummy_sign.name(), "dummy");
let result = ostree::prelude::SignExt::data(
&dummy_sign,
}
fn inner_sign_ed25519<T: SignExt>(signer: T) {
- assert_eq!(signer.name().unwrap(), "ed25519");
+ assert_eq!(signer.name(), "ed25519");
let td = tempfile::tempdir().unwrap();
let path = td.path();