mirror of
https://github.com/NotAShelf/microfetch.git
synced 2025-12-07 21:43:51 +00:00
treewide: fix commonmark formatting in Rustdoc
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ie1a13221aded56f903156fdb35abe2ac6a6a6964
This commit is contained in:
parent
6d6ee838bf
commit
c3a6d1c93c
3 changed files with 14 additions and 5 deletions
|
|
@ -14,7 +14,8 @@ impl UtsName {
|
|||
/// Calls `uname` syscall and returns a `UtsName` wrapper
|
||||
///
|
||||
/// # 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> {
|
||||
let mut uts = MaybeUninit::uninit();
|
||||
if unsafe { libc::uname(uts.as_mut_ptr()) } != 0 {
|
||||
|
|
|
|||
|
|
@ -11,11 +11,15 @@
|
|||
use std::io;
|
||||
|
||||
/// Direct syscall to open a file
|
||||
/// Returns file descriptor or -1 on error
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// File descriptor or -1 on error
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// The caller must ensure:
|
||||
///
|
||||
/// - `path` points to a valid null-terminated C string
|
||||
/// - The pointer remains valid for the duration of the syscall
|
||||
#[inline]
|
||||
|
|
@ -65,7 +69,10 @@ pub unsafe fn sys_open(path: *const u8, flags: i32) -> i32 {
|
|||
}
|
||||
|
||||
/// 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
|
||||
///
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std::{io, mem::MaybeUninit};
|
||||
|
||||
/// Fast integer to string conversion (no formatting overhead)
|
||||
/// Faster integer to string conversion without the formatting overhead.
|
||||
#[inline]
|
||||
fn itoa(mut n: u64, buf: &mut [u8]) -> &str {
|
||||
if n == 0 {
|
||||
|
|
@ -17,9 +17,10 @@ fn itoa(mut n: u64, buf: &mut [u8]) -> &str {
|
|||
unsafe { std::str::from_utf8_unchecked(&buf[i..]) }
|
||||
}
|
||||
|
||||
/// Direct sysinfo syscall using inline assembly
|
||||
/// Direct `sysinfo` syscall using inline assembly
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// This function uses inline assembly to make a direct syscall.
|
||||
/// The caller must ensure the sysinfo pointer is valid.
|
||||
#[inline]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue