treewide: fix commonmark formatting in Rustdoc

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ie1a13221aded56f903156fdb35abe2ac6a6a6964
This commit is contained in:
raf 2025-11-30 15:06:33 +03:00
commit c3a6d1c93c
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
3 changed files with 14 additions and 5 deletions

View file

@ -14,7 +14,8 @@ impl UtsName {
/// Calls `uname` syscall and returns a `UtsName` wrapper /// Calls `uname` syscall and returns a `UtsName` wrapper
/// ///
/// # Errors /// # Errors
/// Returns an error if the uname syscall fails ///
/// Returns an error if the `uname` syscall fails
pub fn uname() -> Result<Self, std::io::Error> { pub fn uname() -> Result<Self, std::io::Error> {
let mut uts = MaybeUninit::uninit(); let mut uts = MaybeUninit::uninit();
if unsafe { libc::uname(uts.as_mut_ptr()) } != 0 { if unsafe { libc::uname(uts.as_mut_ptr()) } != 0 {

View file

@ -11,11 +11,15 @@
use std::io; use std::io;
/// Direct syscall to open a file /// Direct syscall to open a file
/// Returns file descriptor or -1 on error ///
/// # Returns
///
/// File descriptor or -1 on error
/// ///
/// # Safety /// # Safety
/// ///
/// The caller must ensure: /// The caller must ensure:
///
/// - `path` points to a valid null-terminated C string /// - `path` points to a valid null-terminated C string
/// - The pointer remains valid for the duration of the syscall /// - The pointer remains valid for the duration of the syscall
#[inline] #[inline]
@ -65,7 +69,10 @@ pub unsafe fn sys_open(path: *const u8, flags: i32) -> i32 {
} }
/// Direct syscall to read from a file descriptor /// Direct syscall to read from a file descriptor
/// Returns number of bytes read or -1 on error ///
/// # Returns n
///
/// Number of bytes read or -1 on error
/// ///
/// # Safety /// # Safety
/// ///

View file

@ -1,6 +1,6 @@
use std::{io, mem::MaybeUninit}; use std::{io, mem::MaybeUninit};
/// Fast integer to string conversion (no formatting overhead) /// Faster integer to string conversion without the formatting overhead.
#[inline] #[inline]
fn itoa(mut n: u64, buf: &mut [u8]) -> &str { fn itoa(mut n: u64, buf: &mut [u8]) -> &str {
if n == 0 { if n == 0 {
@ -17,9 +17,10 @@ fn itoa(mut n: u64, buf: &mut [u8]) -> &str {
unsafe { std::str::from_utf8_unchecked(&buf[i..]) } unsafe { std::str::from_utf8_unchecked(&buf[i..]) }
} }
/// Direct sysinfo syscall using inline assembly /// Direct `sysinfo` syscall using inline assembly
/// ///
/// # Safety /// # Safety
///
/// This function uses inline assembly to make a direct syscall. /// This function uses inline assembly to make a direct syscall.
/// The caller must ensure the sysinfo pointer is valid. /// The caller must ensure the sysinfo pointer is valid.
#[inline] #[inline]