summaryrefslogtreecommitdiff
path: root/rust/src/collaboration/folder.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-05-07 19:22:21 -0400
committerMason Reed <35282038+emesare@users.noreply.github.com>2025-05-12 17:45:24 -0400
commit2f214f6c9935e8ce8df4732cde44a540a003258c (patch)
tree6fe319433ef0d2ad75fcc58a50eaa632bb627ec9 /rust/src/collaboration/folder.rs
parentb4cf0be8816182c9efca037e27e9439482f8bf36 (diff)
[Rust] Reduce usage of `IntoCStr` in function signatures
This is being done to reduce complexity in function signatures, specifically many of the strings we are passing ultimately should be new types themselves instead of "just strings", things such as type ids. Another place which was confusing was dealing with filesystem related APIs, this commit turns most of those params into a stricter `Path` type. This is bringing the rust api more inline with both python and C++, where the wrapper eagerly converts the string into the languages standard string type. Special consideration must be made for symbols or other possible non utf-8 objects. This commit will be followed up with one that adds the `IntoCStr` bound on API's we want to keep as invalid utf-8 so we can for example, get section by name on a section with invalid utf-8.
Diffstat (limited to 'rust/src/collaboration/folder.rs')
-rw-r--r--rust/src/collaboration/folder.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/rust/src/collaboration/folder.rs b/rust/src/collaboration/folder.rs
index 35ff0788..797bcdd4 100644
--- a/rust/src/collaboration/folder.rs
+++ b/rust/src/collaboration/folder.rs
@@ -103,7 +103,7 @@ impl RemoteFolder {
}
/// Set the display name of the folder. You will need to push the folder to update the remote version.
- pub fn set_name<S: IntoCStr>(&self, name: S) -> Result<(), ()> {
+ pub fn set_name(&self, name: &str) -> Result<(), ()> {
let name = name.to_cstr();
let success = unsafe { BNRemoteFolderSetName(self.handle.as_ptr(), name.as_ptr()) };
success.then_some(()).ok_or(())
@@ -117,7 +117,7 @@ impl RemoteFolder {
}
/// Set the description of the folder. You will need to push the folder to update the remote version.
- pub fn set_description<S: IntoCStr>(&self, description: S) -> Result<(), ()> {
+ pub fn set_description(&self, description: &str) -> Result<(), ()> {
let description = description.to_cstr();
let success =
unsafe { BNRemoteFolderSetDescription(self.handle.as_ptr(), description.as_ptr()) };