mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
clippy: Fix needless_late_init warning (#32052)
This commit is contained in:
parent
e8e909b78c
commit
e3ad76d994
1 changed files with 3 additions and 4 deletions
|
@ -129,8 +129,7 @@ impl CharacterDataMethods for CharacterData {
|
||||||
let data = self.data.borrow();
|
let data = self.data.borrow();
|
||||||
// Step 1.
|
// Step 1.
|
||||||
let mut substring = String::new();
|
let mut substring = String::new();
|
||||||
let remaining;
|
let remaining = match split_at_utf16_code_unit_offset(&data, offset, replace_surrogates) {
|
||||||
match split_at_utf16_code_unit_offset(&data, offset, replace_surrogates) {
|
|
||||||
Ok((_, astral, s)) => {
|
Ok((_, astral, s)) => {
|
||||||
// As if we had split the UTF-16 surrogate pair in half
|
// As if we had split the UTF-16 surrogate pair in half
|
||||||
// and then transcoded that to UTF-8 lossily,
|
// and then transcoded that to UTF-8 lossily,
|
||||||
|
@ -138,11 +137,11 @@ impl CharacterDataMethods for CharacterData {
|
||||||
if astral.is_some() {
|
if astral.is_some() {
|
||||||
substring += "\u{FFFD}";
|
substring += "\u{FFFD}";
|
||||||
}
|
}
|
||||||
remaining = s;
|
s
|
||||||
},
|
},
|
||||||
// Step 2.
|
// Step 2.
|
||||||
Err(()) => return Err(Error::IndexSize),
|
Err(()) => return Err(Error::IndexSize),
|
||||||
}
|
};
|
||||||
match split_at_utf16_code_unit_offset(remaining, count, replace_surrogates) {
|
match split_at_utf16_code_unit_offset(remaining, count, replace_surrogates) {
|
||||||
// Steps 3.
|
// Steps 3.
|
||||||
Err(()) => substring += remaining,
|
Err(()) => substring += remaining,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue