mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Fix two regressions from #26113.
This commit is contained in:
parent
35f872e2d9
commit
3d1df8dce7
2 changed files with 12 additions and 10 deletions
|
@ -714,10 +714,7 @@ impl FontLanguageOverride {
|
|||
|
||||
/// Returns this value as a `&str`, backed by `storage`.
|
||||
#[inline]
|
||||
pub fn to_str(self, storage: &mut [u8; 4]) -> &str {
|
||||
if self.0 == 0 {
|
||||
return "normal";
|
||||
}
|
||||
pub(crate) fn to_str(self, storage: &mut [u8; 4]) -> &str {
|
||||
*storage = u32::to_be_bytes(self.0);
|
||||
// Safe because we ensure it's ASCII during computing
|
||||
let slice = if cfg!(debug_assertions) {
|
||||
|
@ -758,6 +755,9 @@ impl ToCss for FontLanguageOverride {
|
|||
where
|
||||
W: fmt::Write,
|
||||
{
|
||||
if self.0 == 0 {
|
||||
return dest.write_str("normal");
|
||||
}
|
||||
self.to_str(&mut [0; 4]).to_css(dest)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue