Skip to content

Commit ce43ee6

Browse files
committed
macros: Fix indentation of cssparser_internal_to_lowercase.
1 parent 20be7cc commit ce43ee6

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/macros.rs

+12-13
Original file line numberDiff line numberDiff line change
@@ -152,22 +152,21 @@ pub fn _cssparser_internal_to_lowercase<'a>(
152152
input: &'a str,
153153
first_uppercase: usize,
154154
) -> &'a str {
155-
156-
// This cast doesn't change the pointer's validity
157-
// since `u8` has the same layout as `MaybeUninit<u8>`:
158-
let input_bytes = unsafe { &*(input.as_bytes() as *const [u8] as *const [MaybeUninit<u8>]) };
155+
// This cast doesn't change the pointer's validity
156+
// since `u8` has the same layout as `MaybeUninit<u8>`:
157+
let input_bytes =
158+
unsafe { &*(input.as_bytes() as *const [u8] as *const [MaybeUninit<u8>]) };
159159

160-
buffer.copy_from_slice(&*input_bytes);
160+
buffer.copy_from_slice(&*input_bytes);
161161

162-
// Same as above re layout, plus these bytes have been initialized:
163-
let buffer = unsafe { &mut *(buffer as *mut [MaybeUninit<u8>] as *mut [u8]) };
162+
// Same as above re layout, plus these bytes have been initialized:
163+
let buffer = unsafe { &mut *(buffer as *mut [MaybeUninit<u8>] as *mut [u8]) };
164164

165-
buffer[first_uppercase..].make_ascii_lowercase();
166-
// `buffer` was initialized to a copy of `input`
167-
// (which is `&str` so well-formed UTF-8)
168-
// then ASCII-lowercased (which preserves UTF-8 well-formedness):
169-
unsafe { ::std::str::from_utf8_unchecked(buffer) }
170-
165+
buffer[first_uppercase..].make_ascii_lowercase();
166+
// `buffer` was initialized to a copy of `input`
167+
// (which is `&str` so well-formed UTF-8)
168+
// then ASCII-lowercased (which preserves UTF-8 well-formedness):
169+
unsafe { ::std::str::from_utf8_unchecked(buffer) }
171170
}
172171

173172
Some(

0 commit comments

Comments
 (0)