From 788a8b7091bbdde77817030e0836d7a7a786fd99 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sun, 4 May 2025 19:47:55 -0400 Subject: [Rust] Simplify usage surrounding c strings `cstring.as_ref().as_ptr() as *const c_char` -> `cstring.as_ptr()` `cstring.as_ref().as_ptr() as *mut _` -> `cstring.as_ptr()` `cstring.as_ptr() as *const c_char` -> `cstring.as_ptr()` With a few fixes for cstrings that might be dropped prematurely. --- rust/src/collaboration/snapshot.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rust/src/collaboration/snapshot.rs') diff --git a/rust/src/collaboration/snapshot.rs b/rust/src/collaboration/snapshot.rs index 465ae46a..6e1dfb89 100644 --- a/rust/src/collaboration/snapshot.rs +++ b/rust/src/collaboration/snapshot.rs @@ -1,4 +1,4 @@ -use std::ffi::{c_char, c_void}; +use std::ffi::c_void; use std::ptr::NonNull; use std::time::SystemTime; @@ -237,7 +237,7 @@ impl RemoteSnapshot { self.handle.as_ptr(), parent.is_some(), parent.unwrap_or(0), - data.as_ref().as_ptr() as *const c_char, + data.as_ptr(), ) }; let handle = NonNull::new(value).ok_or(())?; -- cgit v1.3.1