From f32f083c81a5034530ac33ad2bc460dd234186a5 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sun, 4 May 2025 20:43:32 -0400 Subject: [Rust] More cleanup regarding `BnString` - Removed `to_string` shortcut from `BnString`. - Misc formatting --- rust/src/collaboration/remote.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'rust/src/collaboration') diff --git a/rust/src/collaboration/remote.rs b/rust/src/collaboration/remote.rs index ee37e9fb..4d69873a 100644 --- a/rust/src/collaboration/remote.rs +++ b/rust/src/collaboration/remote.rs @@ -167,7 +167,7 @@ impl Remote { &self, username: U, password: P, - ) -> Option { + ) -> Option { let username = username.to_cstr(); let password = password.to_cstr(); let token = unsafe { @@ -180,7 +180,7 @@ impl Remote { if token.is_null() { None } else { - Some(unsafe { BnString::from_raw(token) }) + Some(unsafe { BnString::into_string(token) }) } } @@ -226,7 +226,8 @@ impl Remote { }; let username = options.username.to_cstr(); let token = token.to_cstr(); - let success = unsafe { BNRemoteConnect(self.handle.as_ptr(), username.as_ptr(), token.as_ptr()) }; + let success = + unsafe { BNRemoteConnect(self.handle.as_ptr(), username.as_ptr(), token.as_ptr()) }; success.then_some(()).ok_or(()) } -- cgit v1.3.1