File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,8 @@ impl<StrType: AsRef<str> + ?Sized> EqStrUntilNul<StrType> for CStr8 {
147
147
. copied ( )
148
148
. map ( char:: from)
149
149
. zip ( other. chars ( ) )
150
- // this only works as CStr8 is guaranteed to have a fixed character length
150
+ // This only works as CStr8 is guaranteed to have a fixed character length
151
+ // (unlike UTF-8).
151
152
. take_while ( |( l, r) | * l != '\0' && * r != '\0' )
152
153
. any ( |( l, r) | l != r) ;
153
154
@@ -354,7 +355,8 @@ impl<StrType: AsRef<str> + ?Sized> EqStrUntilNul<StrType> for CStr16 {
354
355
. copied ( )
355
356
. map ( char:: from)
356
357
. zip ( other. chars ( ) )
357
- // this only works as CStr16 is guaranteed to have a fixed character length
358
+ // This only works as CStr16 is guaranteed to have a fixed character length
359
+ // (unlike UTF-8 or UTF-16).
358
360
. take_while ( |( l, r) | * l != '\0' && * r != '\0' )
359
361
. any ( |( l, r) | l != r) ;
360
362
@@ -419,7 +421,8 @@ impl<'a> UnalignedSlice<'a, u16> {
419
421
/// The EqStrUntilNul trait helps to compare Rust strings against UEFI string types (UCS-2 strings).
420
422
/// The given generic implementation of this trait enables us that we only have to
421
423
/// implement one direction (`left.eq_str_until_nul(&right)`) for each UEFI string type and we
422
- /// get the other direction (`right.eq_str_until_nul(&left)`) for free.
424
+ /// get the other direction (`right.eq_str_until_nul(&left)`) for free. Hence, the relation is
425
+ /// reflexive.
423
426
pub trait EqStrUntilNul < StrType : ?Sized > {
424
427
/// Checks if the provided Rust string `StrType` is equal to [Self] until the first null-byte
425
428
/// is found. An exception is the terminating null-byte of [Self] which is ignored.
You can’t perform that action at this time.
0 commit comments