summaryrefslogtreecommitdiff
path: root/rust/src
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-07-16 16:13:35 -0400
committerMason Reed <mason@vector35.com>2025-07-17 06:20:20 -0400
commitec2d4e2f5c8efbc0985f27f2dc924eb388cfb243 (patch)
tree06d46de6106385406522380e3bbd1f064490e8ec /rust/src
parent38ff3609c4e2b655c069c0f5c2a7fe1f24d67824 (diff)
[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
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/collaboration.rs12
1 files changed, 12 insertions, 0 deletions
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<Ref<Remote>> {
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<Ref<Remote>> {
+ 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());