about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-10-28 10:24:14 +0200
committerRalf Jung <post@ralfj.de>2022-10-28 10:24:14 +0200
commita6c3f6ce1d5bb2d51f2eb85845277e6e7798695c (patch)
treedc25675fd03712cc9b067b98f7cdb544acbc2749
parentcdd7afeaadf1c48eafb4dff4452439fa5d13a775 (diff)
downloadrust-a6c3f6ce1d5bb2d51f2eb85845277e6e7798695c.tar.gz
rust-a6c3f6ce1d5bb2d51f2eb85845277e6e7798695c.zip
CStr: add some doc links
-rw-r--r--library/core/src/ffi/c_str.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/library/core/src/ffi/c_str.rs b/library/core/src/ffi/c_str.rs
index 55e58c4e0ba..84ee23ebbdc 100644
--- a/library/core/src/ffi/c_str.rs
+++ b/library/core/src/ffi/c_str.rs
@@ -13,9 +13,9 @@ use crate::str;
 /// array of bytes. It can be constructed safely from a <code>&[[u8]]</code>
 /// slice, or unsafely from a raw `*const c_char`. It can then be
 /// converted to a Rust <code>&[str]</code> by performing UTF-8 validation, or
-/// into an owned `CString`.
+/// into an owned [`CString`].
 ///
-/// `&CStr` is to `CString` as <code>&[str]</code> is to `String`: the former
+/// `&CStr` is to [`CString`] as <code>&[str]</code> is to [`String`]: the former
 /// in each pair are borrowed references; the latter are owned
 /// strings.
 ///
@@ -24,6 +24,9 @@ use crate::str;
 /// functions may leverage the unsafe [`CStr::from_ptr`] constructor to provide
 /// a safe interface to other consumers.
 ///
+/// [`CString`]: ../../std/ffi/struct.CString.html
+/// [`String`]: ../../std/string/struct.String.html
+///
 /// # Examples
 ///
 /// Inspecting a foreign C string: