@@ -7,16 +7,16 @@ use dprint_core::configuration::*;
77/// # Example
88///
99/// ```
10- /// use std::collections::HashMap ;
11- /// use dprint_core::configuration::{ resolve_global_config} ;
12- /// use dprint_plugin_typescript::configuration::{ resolve_config} ;
10+ /// use dprint_core::configuration::ConfigKeyMap ;
11+ /// use dprint_core::configuration::resolve_global_config;
12+ /// use dprint_plugin_typescript::configuration::resolve_config;
1313///
14- /// let config_map = HashMap ::new(); // get a collection of key value pairs from somewhere
14+ /// let config_map = ConfigKeyMap ::new(); // get a collection of key value pairs from somewhere
1515/// let global_config_result = resolve_global_config(config_map, &Default::default());
1616///
1717/// // check global_config_result.diagnostics here...
1818///
19- /// let typescript_config_map = HashMap ::new(); // get a collection of k/v pairs from somewhere
19+ /// let typescript_config_map = ConfigKeyMap ::new(); // get a collection of k/v pairs from somewhere
2020/// let config_result = resolve_config(
2121/// typescript_config_map,
2222/// &global_config_result.config
@@ -295,7 +295,6 @@ pub fn resolve_config(config: ConfigKeyMap, global_config: &GlobalConfiguration)
295295mod tests {
296296 use dprint_core:: configuration:: resolve_global_config;
297297 use dprint_core:: configuration:: NewLineKind ;
298- use std:: collections:: HashMap ;
299298
300299 use super :: super :: builder:: ConfigurationBuilder ;
301300 use super :: * ;
@@ -304,7 +303,7 @@ mod tests {
304303
305304 #[ test]
306305 fn handle_global_config ( ) {
307- let mut global_config = HashMap :: new ( ) ;
306+ let mut global_config = ConfigKeyMap :: new ( ) ;
308307 global_config. insert ( String :: from ( "lineWidth" ) , ConfigKeyValue :: from_i32 ( 80 ) ) ;
309308 global_config. insert ( String :: from ( "indentWidth" ) , ConfigKeyValue :: from_i32 ( 8 ) ) ;
310309 global_config. insert ( String :: from ( "newLineKind" ) , ConfigKeyValue :: from_str ( "crlf" ) ) ;
@@ -320,9 +319,9 @@ mod tests {
320319
321320 #[ test]
322321 fn handle_deno_config ( ) {
323- let mut config = HashMap :: new ( ) ;
322+ let mut config = ConfigKeyMap :: new ( ) ;
324323 config. insert ( String :: from ( "deno" ) , ConfigKeyValue :: from_bool ( true ) ) ;
325- let global_config = resolve_global_config ( HashMap :: new ( ) , & Default :: default ( ) ) . config ;
324+ let global_config = resolve_global_config ( ConfigKeyMap :: new ( ) , & Default :: default ( ) ) . config ;
326325 let result = resolve_config ( config, & global_config) ;
327326 let expected_config = ConfigurationBuilder :: new ( ) . deno ( ) . build ( ) ;
328327 // todo: test that both objects equal each other
@@ -333,10 +332,10 @@ mod tests {
333332
334333 #[ test]
335334 fn handle_deno_config_with_overwrites ( ) {
336- let mut config = HashMap :: new ( ) ;
335+ let mut config = ConfigKeyMap :: new ( ) ;
337336 config. insert ( String :: from ( "deno" ) , ConfigKeyValue :: from_bool ( true ) ) ;
338337 config. insert ( String :: from ( "indentWidth" ) , ConfigKeyValue :: from_i32 ( 8 ) ) ;
339- let global_config = resolve_global_config ( HashMap :: new ( ) , & Default :: default ( ) ) . config ;
338+ let global_config = resolve_global_config ( ConfigKeyMap :: new ( ) , & Default :: default ( ) ) . config ;
340339 let result = resolve_config ( config, & global_config) ;
341340 let expected_config = ConfigurationBuilder :: new ( ) . deno ( ) . build ( ) ;
342341 assert_eq ! ( result. config. indent_width, 8 ) ;
0 commit comments