style: Fix two regressions from #26113.

This commit is contained in:
Emilio Cobos Álvarez 2020-04-16 20:54:17 +02:00
parent 35f872e2d9
commit 3d1df8dce7
2 changed files with 12 additions and 10 deletions

View file

@ -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)
}
}