Skip to content

Commit a4b4d3a

Browse files
committed
more doc updates
1 parent 14e97c7 commit a4b4d3a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/raw/cstr.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ use crate::error::{Error, Result};
44

55
#[allow(rustdoc::invalid_rust_codeblocks)]
66
/// A borrowed BSON-spec cstring: Zero or more UTF-8 encoded characters, excluding the nul byte.
7-
/// Most conveniently constructed via the [`cstr!`](crate::raw::cstr) macro.
7+
/// Can be constructed at compile-time via the [`cstr!`](crate::raw::cstr) macro or at run-time via
8+
/// the [`TryFrom`] impl.
89
///
910
/// Unlike [`std::ffi::CStr`], this is required to be valid UTF-8, and does not include the nul
1011
/// terminator in the buffer:
@@ -169,7 +170,8 @@ macro_rules! cstr {
169170
pub use cstr;
170171

171172
/// An owned BSON-spec cstring: Zero or more UTF-8 encoded characters, excluding the nul byte.
172-
/// `CString` is to `CStr` as [`String`] is to [`prim@str`].
173+
/// `CString` is to `CStr` as [`String`] is to [`prim@str`]. Can be constructed from a [`CStr`] via
174+
/// [`ToOwned`]/[`Into`] or from a [`String`] or [`prim@str`] via [`TryFrom`].
173175
///
174176
/// Like `CStr`, this differs from [`std::ffi::CString`] in that it is required to be valid UTF-8,
175177
/// and does not include the nul terminator in the buffer.

0 commit comments

Comments
 (0)