mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-26 10:53:25 +00:00
Fix all spelling mistakes in history by typos tool
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
b29d3b5409
commit
86f09eef75
@ -10,7 +10,7 @@
|
||||
//! which means the `SomeRightSet` should **include** the `AnotherRightSet`. In this case, `AnotherRightSet` should be a **generic parameter**.
|
||||
//! i.e., `AnotherRightSet` should occur the the generic param list of the function.
|
||||
//!
|
||||
//! If there are multiple constraits, they can be seperated with `|`, which means all constraits should be satisfied.
|
||||
//! If there are multiple constraints, they can be separated with `|`, which means all constraints should be satisfied.
|
||||
//!
|
||||
//! The require can also be used multiple times, which means each macro should be satisfied.
|
||||
//!
|
||||
|
@ -135,7 +135,7 @@ pub use typeflags_util::SetContain;
|
||||
/// ```
|
||||
///
|
||||
/// But this coding pattern is too tedius for such a common task.
|
||||
/// To make the life of users easier, we provide a convinient macro named
|
||||
/// To make the life of users easier, we provide a convenient macro named
|
||||
/// `field_ptr`, which can be used to obtain the safe pointer of a field from
|
||||
/// that of its containing struct.
|
||||
///
|
||||
|
@ -9,7 +9,7 @@ cargo install --path .
|
||||
This will install two binaries `cargo-component` and `component-driver` at `$HOME/.cargo/bin`(by default, it depends on the cargo config).
|
||||
|
||||
## Usage
|
||||
Use `cargo component` or `cargo component check` or `cargo component audit`. The three commands are the same now. For Asterinas, we shoud use another alias command `cargo component-check`, which was defined in `src/.cargo/config.toml`.
|
||||
Use `cargo component` or `cargo component check` or `cargo component audit`. The three commands are the same now. For Asterinas, we should use another alias command `cargo component-check`, which was defined in `src/.cargo/config.toml`.
|
||||
|
||||
### Two notes:
|
||||
- The directory **where you run the command** should contains a `Components.toml` config file, where defines all components and whitelist.
|
||||
|
@ -166,7 +166,7 @@ fn check_inline_asm_operand(
|
||||
|
||||
/// check whether visiting the operand in local crate is valid.
|
||||
/// if the operand is invalid, add the def_path to def_paths.
|
||||
/// The operand is invalid only when follwing four points are all satisfied.
|
||||
/// The operand is invalid only when following four points are all satisfied.
|
||||
/// 1. The operand represents a static variable or a func(the first argument can not be self or its variants).
|
||||
/// 2. The operand is not defined in local crate.
|
||||
/// 3. The operand is marked with #[component_access_control::controlled]
|
||||
|
@ -180,7 +180,7 @@ fn read_component_file(workspace_root: &str) -> Vec<String> {
|
||||
.collect();
|
||||
}
|
||||
}
|
||||
panic!("Componets.toml file not valid")
|
||||
panic!("Components.toml file not valid")
|
||||
}
|
||||
|
||||
/// calculate the priority of one node
|
||||
|
@ -11,7 +11,7 @@ Registering a crate as component by marking a function in the lib.rs with `#[ini
|
||||
|
||||
### Component initialization
|
||||
|
||||
Component system need to be initialized by calling `componet::init_all` function and it needs information about all components. Usually it is used with the `component::parse_metadata` macro.
|
||||
Component system need to be initialized by calling `component::init_all` function and it needs information about all components. Usually it is used with the `component::parse_metadata` macro.
|
||||
|
||||
## Example
|
||||
|
||||
|
@ -128,7 +128,7 @@ fn parse_input(components: Vec<ComponentInfo>) -> BTreeMap<String, ComponentInfo
|
||||
out
|
||||
}
|
||||
|
||||
/// Match the ComponetInfo with ComponentRegistry. The key is the relative path of one component
|
||||
/// Match the ComponentInfo with ComponentRegistry. The key is the relative path of one component
|
||||
fn match_and_call(
|
||||
mut components: BTreeMap<String, ComponentInfo>,
|
||||
) -> Result<(), ComponentSystemInitError> {
|
||||
@ -161,7 +161,7 @@ fn match_and_call(
|
||||
infos.push(info);
|
||||
}
|
||||
|
||||
debug!("Remain componets:{components:?}");
|
||||
debug!("Remain components:{components:?}");
|
||||
|
||||
if !components.is_empty() {
|
||||
info!("Exists components that are not initialized");
|
||||
@ -174,11 +174,11 @@ fn match_and_call(
|
||||
for i in infos {
|
||||
info!("Component initializing:{:?}", i);
|
||||
if let Err(res) = i.function.unwrap().call(()) {
|
||||
error!("Component initalize error:{:?}", res);
|
||||
error!("Component initialize error:{:?}", res);
|
||||
} else {
|
||||
info!("Component initalize complete");
|
||||
info!("Component initialize complete");
|
||||
}
|
||||
}
|
||||
info!("All components initalization completed");
|
||||
info!("All components initialization completed");
|
||||
Ok(())
|
||||
}
|
||||
|
@ -31,5 +31,5 @@ fn main() {
|
||||
|
||||
## Introduction
|
||||
This crate provides a derive procedural macro named `TryFromInt`. This macro will automatically implement [TryFrom](https://doc.rust-lang.org/core/convert/trait.TryFrom.html) trait for enums that meet the following requirements:
|
||||
1. The enum must have a primitive repr, i.e., the enum should have attribute like #[repr(u8)], #[repr(u32)], etc. The type parameter of TryFrom will be the repr, e.g., in the `QuickStart` example, the macro will implment `TryFrom<u8>` for `Color`.
|
||||
1. The enum must have a primitive repr, i.e., the enum should have attribute like #[repr(u8)], #[repr(u32)], etc. The type parameter of TryFrom will be the repr, e.g., in the `QuickStart` example, the macro will implement `TryFrom<u8>` for `Color`.
|
||||
2. The enum must consist solely of unit variants, which is called [units only enum](https://doc.rust-lang.org/reference/items/enumerations.html#unit-only-enum). Each field should have an **explicit discriminant**.
|
||||
|
@ -69,8 +69,8 @@ fn fn_body_tokens(value_name: &str, data_enum: &DataEnum, ident: Ident) -> Token
|
||||
.discriminant
|
||||
.as_ref()
|
||||
.expect("Each field must be assigned a discriminant value explicitly");
|
||||
let vairant_ident = &variant.ident;
|
||||
let statement = quote!(#value => ::core::result::Result::Ok(#ident::#vairant_ident),);
|
||||
let variant_ident = &variant.ident;
|
||||
let statement = quote!(#value => ::core::result::Result::Ok(#ident::#variant_ident),);
|
||||
match_bodys.append_all(statement);
|
||||
}
|
||||
match_bodys.append_all(
|
||||
|
@ -10,7 +10,7 @@ use crate::type_flag::TypeFlagDef;
|
||||
const EMPTY_SET_NAME: &str = "::typeflags_util::Nil";
|
||||
const SET_NAME: &str = "::typeflags_util::Cons";
|
||||
|
||||
/// A flagSet represent the combination of differnt flag item.
|
||||
/// A flagSet represent the combination of different flag item.
|
||||
/// e.g. [Read, Write], [Read], [] are all flag sets.
|
||||
/// The order of flagItem does not matters. So flag sets with same sets of items should be viewed as the same set.
|
||||
#[derive(Debug)]
|
||||
|
@ -25,8 +25,8 @@ pub fn expand_type_flag(type_flags_def: &TypeFlagDef) -> TokenStream {
|
||||
all_tokens.append_all(impl_main_trait_tokens);
|
||||
});
|
||||
|
||||
let impl_set_entend_tokens = impl_set_extend(type_flags_def, &flag_sets);
|
||||
all_tokens.append_all(impl_set_entend_tokens);
|
||||
let impl_set_intend_tokens = impl_set_extend(type_flags_def, &flag_sets);
|
||||
all_tokens.append_all(impl_set_intend_tokens);
|
||||
|
||||
let export_declarive_macro_tokens = export_declarive_macro(type_flags_def, &flag_sets);
|
||||
all_tokens.append_all(export_declarive_macro_tokens);
|
||||
|
Reference in New Issue
Block a user