mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +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();
|
||||
// Step 1.
|
||||
let mut substring = String::new();
|
||||
let remaining;
|
||||
match split_at_utf16_code_unit_offset(&data, offset, replace_surrogates) {
|
||||
let remaining = match split_at_utf16_code_unit_offset(&data, offset, replace_surrogates) {
|
||||
Ok((_, astral, s)) => {
|
||||
// As if we had split the UTF-16 surrogate pair in half
|
||||
// and then transcoded that to UTF-8 lossily,
|
||||
|
@ -138,11 +137,11 @@ impl CharacterDataMethods for CharacterData {
|
|||
if astral.is_some() {
|
||||
substring += "\u{FFFD}";
|
||||
}
|
||||
remaining = s;
|
||||
s
|
||||
},
|
||||
// Step 2.
|
||||
Err(()) => return Err(Error::IndexSize),
|
||||
}
|
||||
};
|
||||
match split_at_utf16_code_unit_offset(remaining, count, replace_surrogates) {
|
||||
// Steps 3.
|
||||
Err(()) => substring += remaining,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue