File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,36 @@ impl Debug for AugmentedScriptSet {
105
105
}
106
106
}
107
107
108
+ impl fmt:: Display for AugmentedScriptSet {
109
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
110
+ if self . is_empty ( ) {
111
+ write ! ( f, "Empty" ) ?;
112
+ } else if self . is_all ( ) {
113
+ write ! ( f, "All" ) ?;
114
+ } else {
115
+ let mut first_entry = true ;
116
+ let hanb = if self . hanb { Some ( "Han with Bopomofo" ) } else { None } ;
117
+ let jpan = if self . jpan { Some ( "Japanese" ) } else { None } ;
118
+ let kore = if self . kore { Some ( "Krorean" ) } else { None } ;
119
+ for writing_system in None
120
+ . into_iter ( )
121
+ . chain ( hanb)
122
+ . chain ( jpan)
123
+ . chain ( kore)
124
+ . chain ( self . base . iter ( ) . map ( Script :: full_name) )
125
+ {
126
+ if !first_entry {
127
+ write ! ( f, ", " ) ?;
128
+ } else {
129
+ first_entry = false ;
130
+ }
131
+ write ! ( f, "{}" , writing_system) ?;
132
+ }
133
+ }
134
+ Ok ( ( ) )
135
+ }
136
+ }
137
+
108
138
impl AugmentedScriptSet {
109
139
/// Intersect this set with another
110
140
pub fn intersect_with ( & mut self , other : Self ) {
You can’t perform that action at this time.
0 commit comments