Skip to content

Commit 6b48cb8

Browse files
committed
Leaner objc2
1 parent c939c41 commit 6b48cb8

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

‎Cargo.toml‎

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,24 @@ winapi = { version = "0.3.8", features = ["libloaderapi", "winuser", "windef", "
3939
uuid = { version = "0.8", features = ["v4"], optional = true }
4040

4141
[target.'cfg(target_os="macos")'.dependencies]
42-
uuid = { version = "0.8", features = ["v4"] }
43-
# TODO: only enable needed features
42+
uuid = { version = "1.23.1", features = ["v4"] }
4443
objc2 = "0.6.4"
45-
objc2-core-foundation = "0.3.2"
46-
objc2-foundation = "0.3.2"
47-
objc2-app-kit = { version = "0.3.2", features = ["objc2-open-gl"] }
44+
objc2-core-foundation = { version = "0.3.2", default-features = false, features = ["std"] }
45+
objc2-foundation = { version = "0.3.2", default-features = false, features = ["std", "NSEnumerator"] }
46+
objc2-app-kit = { version = "0.3.2", default-features = false, features = [
47+
"NSApplication",
48+
"NSDragging",
49+
"NSEvent",
50+
"NSGraphics",
51+
"NSPasteboard",
52+
"NSResponder",
53+
"NSRunningApplication",
54+
"NSTrackingArea",
55+
"NSView",
56+
"NSWindow",
57+
"objc2-open-gl",
58+
"objc2-core-foundation"
59+
] }
4860

4961
[dev-dependencies]
5062
rtrb = "0.2"

‎src/macos/view.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ fn create_view_class() -> &'static AnyClass {
124124
// the class was stored in a OnceCell after creation. This way, we didn't
125125
// have to recreate it each time a view was opened, but now we don't leave
126126
// any class definitions lying around when the plugin is closed.
127-
let class_name = CString::new(format!("BaseviewNSView_{}", Uuid::new_v4().to_simple()))
127+
let class_name = CString::new(format!("BaseviewNSView_{}", Uuid::new_v4().simple()))
128128
// PANIC: This cannot have any NULL bytes
129129
.unwrap();
130130

0 commit comments

Comments
 (0)