Skip to content

Commit 1d75a9d

Browse files
authored
Merge pull request #6 from unicode-rs/fmt
Add Display impls
2 parents 2543254 + 9f74354 commit 1d75a9d

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/lib.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ impl From<char> for Script {
112112
}
113113
}
114114

115+
impl fmt::Display for Script {
116+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
117+
write!(f, "{}", self.full_name())
118+
}
119+
}
120+
115121
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
116122
#[non_exhaustive]
117123
/// A value for the `Script_Extension` property
@@ -295,6 +301,13 @@ impl From<&'_ str> for ScriptExtension {
295301
impl fmt::Debug for ScriptExtension {
296302
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
297303
write!(f, "ScriptExtension(")?;
304+
fmt::Display::fmt(self, f)?;
305+
write!(f, ")")
306+
}
307+
}
308+
309+
impl fmt::Display for ScriptExtension {
310+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
298311
if self.is_common() {
299312
write!(f, "Common")?;
300313
} else if self.is_inherited() {
@@ -311,7 +324,7 @@ impl fmt::Debug for ScriptExtension {
311324
script.full_name().fmt(f)?;
312325
}
313326
}
314-
write!(f, ")")
327+
Ok(())
315328
}
316329
}
317330

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy