summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2026-05-08 19:51:57 -0700
committerMason Reed <35282038+emesare@users.noreply.github.com>2026-05-10 17:13:08 -0700
commit698780be936560dc11a19b80d0236f80d9753b42 (patch)
tree0a2eb21f45c177695ebdada639ccd09b8d5fbdf2
parent0a9a0b3185eb6e8b85c7e29a85f396af199a8262 (diff)
[Rust] Fix misc improper collaboration project function signatures
We should not be using Ref<T> in functions which do not require ref counted ownership Also changes `Project::default_project_path` to return `PathBuf`
-rw-r--r--rust/src/collaboration/project.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/rust/src/collaboration/project.rs b/rust/src/collaboration/project.rs
index 8ee53f6a..8ea7c028 100644
--- a/rust/src/collaboration/project.rs
+++ b/rust/src/collaboration/project.rs
@@ -766,7 +766,7 @@ impl RemoteProject {
/// # Arguments
///
/// * `user` - User to check
- pub fn can_user_view(&self, user: Ref<RemoteUser>) -> bool {
+ pub fn can_user_view(&self, user: &RemoteUser) -> bool {
unsafe { BNRemoteProjectCanUserView(self.handle.as_ptr(), user.handle.as_ptr()) }
}
@@ -775,7 +775,7 @@ impl RemoteProject {
/// # Arguments
///
/// * `user` - User to check
- pub fn can_user_edit(&self, user: Ref<RemoteUser>) -> bool {
+ pub fn can_user_edit(&self, user: &RemoteUser) -> bool {
unsafe { BNRemoteProjectCanUserEdit(self.handle.as_ptr(), user.handle.as_ptr()) }
}
@@ -784,16 +784,17 @@ impl RemoteProject {
/// # Arguments
///
/// * `user` - User to check
- pub fn can_user_admin(&self, user: Ref<RemoteUser>) -> bool {
+ pub fn can_user_admin(&self, user: &RemoteUser) -> bool {
unsafe { BNRemoteProjectCanUserAdmin(self.handle.as_ptr(), user.handle.as_ptr()) }
}
/// Get the default directory path for a remote Project. This is based off
/// the Setting for collaboration.directory, the project's id, and the
/// project's remote's id.
- pub fn default_project_path(&self) -> String {
+ pub fn default_project_path(&self) -> PathBuf {
let result = unsafe { BNCollaborationDefaultProjectPath(self.handle.as_ptr()) };
- unsafe { BnString::into_string(result) }
+ let result_str = unsafe { BnString::into_string(result) };
+ PathBuf::from(result_str)
}
/// Upload a file, with database, to the remote under the given project