Skip to content

Commit

Permalink
remove impl Default for XPCObject
Browse files Browse the repository at this point in the history
  • Loading branch information
mach-kernel committed Dec 21, 2023
1 parent 30d76fc commit 335bdcf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion xpc-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "xpc-sys"
description = "Conveniently call routines with wrappers for xpc_pipe_routine() and go from Rust types to XPC objects and back!"
version = "0.4.3"
version = "0.5.0"
authors = ["David Stancu <[email protected]>"]
license = "MIT"
edition = "2018"
Expand Down
20 changes: 0 additions & 20 deletions xpc-sys/src/objects/xpc_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ impl XPCObject {
}
}

impl Default for XPCObject {
fn default() -> Self {
Self(null_mut(), XPCType(null_mut()))
}
}

impl fmt::Display for XPCObject {
/// Use xpc_copy_description to show as a string, for
/// _xpc_type_dictionary contents are shown!
Expand Down Expand Up @@ -267,18 +261,4 @@ mod tests {
assert!(obj.get_refs().is_some())
}
}

#[test]
fn drop_default() {
let my_obj = XPCObject::default();
drop(my_obj);
}

#[test]
fn display_default() {
let my_obj = XPCObject::default();
assert!(
format!("{}", my_obj) == "XPCObject(0x0, XPCType(0x0)) xpc_object_t is NULL"
);
}
}

0 comments on commit 335bdcf

Please sign in to comment.