Skip to content

Commit 7117237

Browse files
committed
Document that CxxString::as_ptr is not for writing
1 parent 9dd602d commit 7117237

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/cxx_string.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ impl CxxString {
130130
/// internal null bytes. As such, the returned pointer only makes sense as a
131131
/// string in combination with the length returned by [`len()`][len].
132132
///
133+
/// Modifying the string data through this pointer has undefined behavior.
134+
///
133135
/// [data]: https://en.cppreference.com/w/cpp/string/basic_string/data
134136
/// [len]: #method.len
135137
pub fn as_ptr(&self) -> *const u8 {

0 commit comments

Comments
 (0)