File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -402,8 +402,15 @@ struct ConfigSeqAccess {
402402impl ConfigSeqAccess {
403403 fn new ( de : Deserializer < ' _ > ) -> Result < ConfigSeqAccess , ConfigError > {
404404 let mut res = Vec :: new ( ) ;
405- if let Some ( v) = de. gctx . _get_list ( & de. key ) ? {
406- res. extend ( v. val ) ;
405+
406+ match de. gctx . get_cv ( & de. key ) ? {
407+ Some ( CV :: List ( val, _definition) ) => {
408+ res. extend ( val) ;
409+ }
410+ Some ( val) => {
411+ de. gctx . expected ( "list" , & de. key , & val) ?;
412+ }
413+ None => { }
407414 }
408415
409416 de. gctx . get_env_list ( & de. key , & mut res) ?;
Original file line number Diff line number Diff line change @@ -995,13 +995,9 @@ impl GlobalContext {
995995 /// if you want that.
996996 pub fn get_list ( & self , key : & str ) -> CargoResult < OptValue < Vec < ( String , Definition ) > > > {
997997 let key = ConfigKey :: from_str ( key) ;
998- self . _get_list ( & key)
999- }
1000-
1001- fn _get_list ( & self , key : & ConfigKey ) -> CargoResult < OptValue < Vec < ( String , Definition ) > > > {
1002- match self . get_cv ( key) ? {
998+ match self . get_cv ( & key) ? {
1003999 Some ( CV :: List ( val, definition) ) => Ok ( Some ( Value { val, definition } ) ) ,
1004- Some ( val) => self . expected ( "list" , key, & val) ,
1000+ Some ( val) => self . expected ( "list" , & key, & val) ,
10051001 None => Ok ( None ) ,
10061002 }
10071003 }
You can’t perform that action at this time.
0 commit comments