File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ impl str::FromStr for Params {
265265 /// or from an upgrade (when a key is dropped but was used in the past)
266266 fn from_str ( s : & str ) -> std:: result:: Result < Self , Self :: Err > {
267267 let mut inner = BTreeMap :: new ( ) ;
268- let mut lines = s. lines ( ) . peekable ( ) ;
268+ let mut lines = s. split ( '\n' ) . peekable ( ) ;
269269
270270 while let Some ( line) = lines. next ( ) {
271271 if let [ key, value] = line. splitn ( 2 , '=' ) . collect :: < Vec < _ > > ( ) [ ..] {
@@ -457,6 +457,7 @@ mod tests {
457457 let mut params = Params :: new ( ) ;
458458 params. set ( Param :: Height , "foo\n bar=baz\n quux" ) ;
459459 params. set ( Param :: Width , "\n \n \n a=\n =" ) ;
460+ params. set ( Param :: WebrtcRoom , "foo\r \n bar\r \n \r \n baz\r \n " ) ;
460461 assert_eq ! ( params. to_string( ) . parse:: <Params >( ) . unwrap( ) , params) ;
461462 }
462463
You can’t perform that action at this time.
0 commit comments