@@ -13,14 +13,14 @@ use std::str::FromStr;
1313
1414use regex:: Regex ;
1515
16- use source:: utils:: read;
16+ use crate :: source:: utils:: read;
1717
18- use super :: { DataEntry , parse_entries_from_str } ;
18+ use super :: { parse_entries_from_str , DataEntry } ;
1919
2020lazy_static ! {
2121 /// [Variants]: http://www.unicode.org/reports/tr38/#N10211
2222 pub static ref UNIHAN_VARIANTS_DATA : VariantsData = {
23- read( "data/ ucd/Unihan/Unihan_Variants.txt" ) . parse( ) . unwrap( )
23+ read( "external/unicode/ ucd/data /Unihan/Unihan_Variants.txt" ) . parse( ) . unwrap( )
2424 } ;
2525
2626 pub static ref VALUE_REGEX : Regex = Regex :: new(
@@ -75,20 +75,24 @@ impl DataEntry for VariantsDataEntry {
7575
7676 fn update < ' a > ( & mut self , key : & ' a str , value : & ' a str ) {
7777 match key {
78- "kSemanticVariant" =>
78+ "kSemanticVariant" => {
7979 self . semantic_variants =
80- Some ( VariantsDataEntry :: parse_values_with_additional_data ( value) ) ,
81- "kSimplifiedVariant" =>
82- self . simplified_variant = Some ( VariantsDataEntry :: parse_value ( value) ) ,
83- "kSpecializedSemanticVariant" =>
80+ Some ( VariantsDataEntry :: parse_values_with_additional_data ( value) )
81+ }
82+ "kSimplifiedVariant" => {
83+ self . simplified_variant = Some ( VariantsDataEntry :: parse_value ( value) )
84+ }
85+ "kSpecializedSemanticVariant" => {
8486 self . specialized_semantic_variants =
85- Some ( VariantsDataEntry :: parse_values_with_additional_data ( value) ) ,
86- "kTraditionalVariant" =>
87- self . traditional_variant = Some ( VariantsDataEntry :: parse_value ( value) ) ,
88- "kZVariant" =>
89- self . z_variants =
90- Some ( VariantsDataEntry :: parse_values_with_additional_data ( value) ) ,
91- _ => { } ,
87+ Some ( VariantsDataEntry :: parse_values_with_additional_data ( value) )
88+ }
89+ "kTraditionalVariant" => {
90+ self . traditional_variant = Some ( VariantsDataEntry :: parse_value ( value) )
91+ }
92+ "kZVariant" => {
93+ self . z_variants = Some ( VariantsDataEntry :: parse_values_with_additional_data ( value) )
94+ }
95+ _ => { }
9296 }
9397 }
9498}
0 commit comments