Skip to content

Commit

Permalink
Reduce typo count. (unicode-org#5477)
Browse files Browse the repository at this point in the history
NFC
  • Loading branch information
waywardmonkeys authored Sep 10, 2024
1 parent 4c68522 commit 18b44b9
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion components/collator/src/elements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ where
// There are two possible patterns:
// BMP: starter, starter, non-starter
// Plane 1: starter, starter.
// However, for forward compatility, support any combination
// However, for forward compatibility, support any combination
// and search for the last starter.
let mut i = self.upcoming.len() - 1;
loop {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ impl<'a> FromIterator<&'a str> for CodePointInversionListAndStringList<'_> {
}

// Ensure that the string list is sorted. If not, the binary search that
// is used for `.contains(&str)` will return garbase otuput.
// is used for `.contains(&str)` will return garbage output.
strings.sort_unstable();
strings.dedup();

Expand Down
2 changes: 1 addition & 1 deletion components/experimental/src/displaynames/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub struct DisplayNamesOptions {
}

/// An enum for formatting style.
#[allow(missing_docs)] // The variants are self explanotory.
#[allow(missing_docs)] // The variants are self explanatory.
#[non_exhaustive]
#[derive(Debug, Eq, PartialEq, Clone, Copy)]
pub enum Style {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

// A sample application which takes a comma separated list of locales,
// makes them syntatically canonical and serializes the list back into a comma separated list.
// makes them syntactically canonical and serializes the list back into a comma separated list.

#![no_main] // https://github.com/unicode-org/icu4x/issues/395
icu_benchmark_macros::instrument!();
Expand Down
2 changes: 1 addition & 1 deletion components/locale_core/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const fn skip_before_separator(slice: &[u8]) -> &[u8] {
#[derive(Copy, Clone, Debug)]
pub struct SubtagIterator<'a> {
remaining: &'a [u8],
// current is a prefix of remaning
// current is a prefix of remaining
current: Option<&'a [u8]>,
}

Expand Down
4 changes: 2 additions & 2 deletions components/properties/src/props.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ impl_value_getter! {
/// Enumerated property Hangul_Syllable_Type
///
/// The Unicode standard provides both precomposed Hangul syllables and conjoining Jamo to compose
/// arbitrary Hangul syllables. This property provies that ontology of Hangul code points.
/// arbitrary Hangul syllables. This property provides that ontology of Hangul code points.
///
/// For more information, see the [Unicode Korean FAQ](https://www.unicode.org/faq/korean.html).
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
Expand All @@ -1600,7 +1600,7 @@ impl HangulSyllableType {
pub const LeadingJamo: HangulSyllableType = HangulSyllableType(1);
/// (`V`) a conjoining vowel Jamo.
pub const VowelJamo: HangulSyllableType = HangulSyllableType(2);
/// (`T`) a conjoining trailing consonent Jamo.
/// (`T`) a conjoining trailing consonant Jamo.
pub const TrailingJamo: HangulSyllableType = HangulSyllableType(3);
/// (`LV`) a precomposed syllable with a leading consonant and a vowel.
pub const LeadingVowelSyllable: HangulSyllableType = HangulSyllableType(4);
Expand Down
2 changes: 1 addition & 1 deletion components/properties/src/sets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ make_code_point_set_property! {
/// let case_ignorable = sets::case_ignorable();
///
/// assert!(case_ignorable.contains(':'));
/// assert!(!case_ignorable.contains('λ')); // U+03BB GREEK SMALL LETTER LAMDA
/// assert!(!case_ignorable.contains('λ')); // U+03BB GREEK SMALL LETTER LAMBDA
/// ```
pub const fn case_ignorable() => SINGLETON_CASE_IGNORABLE_V1_MARKER;
Expand Down
2 changes: 1 addition & 1 deletion components/timezone/src/ixdtf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub enum ParseError {
Range(RangeError),
/// Parsed date and time records were not a valid ISO date.
Date(DateError),
/// There was no time zone offset or IANA identifer found.
/// There was no time zone offset or IANA identifier found.
MissingTimeZone,
/// There were missing fields required to parse component.
MissingFields,
Expand Down
2 changes: 1 addition & 1 deletion documents/process/style_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ fn function_name(param: ParamType) -> ReturnType { … }

may still have parameters "passed by reference" when it can determine that the reference is no longer subsequently used by the calling code (this is a "move" in Rust parlance).

Furthermore, it will often [ellide the copy](https://en.wikipedia.org/wiki/Copy_elision) of the return value if it determines the returned object would otherwise go out of scope. It will allocate the space for the return value on the caller's stack or use the memory in a destination struct, to directly write the "returned" value in its final destination with no copying whatsoever. This is called Return Value Optimization (RVO) and while it is now available in C++ as well, it's a relatively new feature there.
Furthermore, it will often [elide the copy](https://en.wikipedia.org/wiki/Copy_elision) of the return value if it determines the returned object would otherwise go out of scope. It will allocate the space for the return value on the caller's stack or use the memory in a destination struct, to directly write the "returned" value in its final destination with no copying whatsoever. This is called Return Value Optimization (RVO) and while it is now available in C++ as well, it's a relatively new feature there.

It is still often better (for reasons of borrowing and ownership) to pass structs by non-mutable reference, but returning **newly created** results by value (even potentially large structures) is not expected to cause performance issues.

Expand Down

0 comments on commit 18b44b9

Please sign in to comment.