From ec2d4e2f5c8efbc0985f27f2dc924eb388cfb243 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Wed, 16 Jul 2025 16:13:35 -0400 Subject: [Rust] Misc fixes / formatting - Fix cmake clean not cleaning target docs - Fix not prioritizing enterprise remote in collab tests - Some misc formatting - Fix incorrect assert in binary loading --- rust/src/collaboration.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'rust/src') diff --git a/rust/src/collaboration.rs b/rust/src/collaboration.rs index 0a17d94c..8c9734f8 100644 --- a/rust/src/collaboration.rs +++ b/rust/src/collaboration.rs @@ -52,6 +52,18 @@ pub fn active_remote() -> Option> { NonNull::new(value).map(|h| unsafe { Remote::ref_from_raw(h) }) } +/// Get the enterprise remote. +/// +/// NOTE: There can only be one because that it is associated with the enterprise client user. +pub fn enterprise_remote() -> Option> { + for remote in &known_remotes() { + if remote.is_enterprise().unwrap_or(false) { + return Some(remote.clone()); + } + } + None +} + /// Set the single actively connected Remote pub fn set_active_remote(remote: Option<&Remote>) { let remote_ptr = remote.map_or(std::ptr::null_mut(), |r| r.handle.as_ptr()); -- cgit v1.3.1