fix typos in code documentation

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
This commit is contained in:
Maximiliano Sandoval 2024-07-18 15:05:32 +02:00 committed by Thomas Lamprecht
parent 72ab48eb55
commit 254a37ae07
11 changed files with 12 additions and 12 deletions

View File

@ -683,7 +683,7 @@ fn extract_normal_parameter(
body.extend(quote_spanned! { span => ; });
}
Some(flatten_span) => {
// Flattened parameter, we need ot use our special partial-object deserializer.
// Flattened parameter, we need to use our special partial-object deserializer.
// Also note that we do not support simply nesting schemas. We need a referenced type.
// Otherwise the expanded code here gets ugly and we'd need to make sure we pull out
// nested schemas into named variables first... No thanks.

View File

@ -29,7 +29,7 @@ pub fn get_api_user() -> &'static nix::unistd::User {
}
}
// Returns the global priviledged user set with [init].
// Returns the global privileged user set with [init].
///
/// # Panics
///

View File

@ -422,7 +422,7 @@ async fn get_request_parameters<S: 'static + BuildHasher + Send>(
std::str::from_utf8(&body).map_err(|err| format_err!("Request body not uft8: {}", err))?;
if is_json {
// treat empty body as empty paramater hash
// treat empty body as empty parameter hash
let mut params: Value = if utf8_data.is_empty() {
Value::Object(serde_json::Map::new())
} else {

View File

@ -147,7 +147,7 @@ fn parse_nested_command<'a>(
) -> Result<&'a CliCommand, Error> {
let mut map = def;
// Note: Avoid async recursive function, because current rust compiler cant handle that
// Note: Avoid async recursive function, because current rust compiler can't handle that
loop {
replace_aliases(args, &map.aliases);

View File

@ -168,7 +168,7 @@ fn get_simple_completion_do(
return Vec::new();
}
// Try to parse all argumnets but last, record args already done
// Try to parse all arguments but last, record args already done
if args.len() > 1 {
let mut errors = ParameterError::new(); // we simply ignore any parsing errors here
let (data, _remaining) = super::getopts::parse_argument_list(

View File

@ -300,7 +300,7 @@ fn apply_journal_lines(
linenr,
err,
);
continue; // skip unparseable lines
continue; // skip unparsable lines
}
};

View File

@ -218,13 +218,13 @@ pub fn atomic_open_or_create_file<P: AsRef<Path>>(
}
let exclusive = if oflag.contains(OFlag::O_EXCL) {
oflag.remove(OFlag::O_EXCL); // we nned to handle that ourselfes
oflag.remove(OFlag::O_EXCL); // we need to handle that ourselves
true
} else {
false
};
oflag.remove(OFlag::O_CREAT); // we want to handle CREAT ourselfes
oflag.remove(OFlag::O_CREAT); // we want to handle CREAT ourselves
if !exclusive {
// Note: 'mode' is ignored, because oflag does not contain O_CREAT or O_TMPFILE

View File

@ -271,7 +271,7 @@ fn do_setup_timeout_handler() -> io::Result<()> {
Ok(())
}
// The first time we unblock SIGTIMEOUT should cause approprate initialization:
// The first time we unblock SIGTIMEOUT should cause appropriate initialization:
static SETUP_TIMEOUT_HANDLER: std::sync::Once = std::sync::Once::new();
/// Setup our timeout-signal workflow. This establishes the signal handler for

View File

@ -58,7 +58,7 @@ pub fn epoch_to_rfc3339(epoch: i64) -> Result<String, Error> {
/// Parse RFC3339 into Unix epoch
pub fn parse_rfc3339(input_str: &str) -> Result<i64, Error> {
// TOTO: This should parse olny RFC3339, but currently also parse
// TOTO: This should parse only RFC3339, but currently also parse
// other formats
let time_milli = js_sys::Date::parse(input_str);
if time_milli.is_nan() {

View File

@ -95,7 +95,7 @@ impl Uuid {
use std::alloc::{alloc, Layout};
let uuid: *mut [u8; 16] = unsafe { alloc(Layout::new::<[u8; 16]>()) as *mut [u8; 16] };
if src.len() == 36 {
// Unfortunately the manpage of `uuid_parse(3)` states that it technically requiers a
// Unfortunately the manpage of `uuid_parse(3)` states that it technically requires a
// terminating null byte at the end, which we don't have, so do this manually:
let uuid: &mut [u8] = unsafe { &mut (*uuid)[..] };
let src = src.as_bytes();

View File

@ -3,7 +3,7 @@ use std::fmt;
use crate::Uuid;
pub fn uuid_generate(out: *mut [u8; 16]) {
// TODO: implement soemthing better than this
// TODO: implement something better than this
let time = js_sys::Date::now() as u64;
let random1 = (js_sys::Math::random() * f64::MAX) as u64;