@@ -810,7 +810,7 @@ impl Ini {
810
810
for ( k, v) in props. iter ( ) {
811
811
let k_str = escape_str ( k, opt. escape_policy ) ;
812
812
let v_str = escape_str ( v, opt. escape_policy ) ;
813
- write ! ( writer, "{}= {}{}" , k_str, v_str, opt. line_separator) ?;
813
+ write ! ( writer, "{}{}{}{} " , k_str, opt . kv_separator , v_str, opt. line_separator) ?;
814
814
815
815
firstline = false ;
816
816
}
@@ -2119,6 +2119,9 @@ a3 = n3
2119
2119
use std:: str;
2120
2120
2121
2121
let mut ini = Ini :: new ( ) ;
2122
+ ini. with_section ( None :: < String > )
2123
+ . set ( "Key1" , "Value" )
2124
+ . set ( "Key2" , "Value" ) ;
2122
2125
ini. with_section ( Some ( "Section1" ) )
2123
2126
. set ( "Key1" , "Value" )
2124
2127
. set ( "Key2" , "Value" ) ;
@@ -2139,12 +2142,12 @@ a3 = n3
2139
2142
// Test different line endings in Windows and Unix
2140
2143
if cfg ! ( windows) {
2141
2144
assert_eq ! (
2142
- "[Section1]\r \n Key1 = Value\r \n Key2 = Value\r \n \r \n [Section2]\r \n Key1 = Value\r \n Key2 = Value\r \n " ,
2145
+ "Key1 = Value \r \n Key2 = Value \r \n \r \n [Section1]\r \n Key1 = Value\r \n Key2 = Value\r \n \r \n [Section2]\r \n Key1 = Value\r \n Key2 = Value\r \n " ,
2143
2146
str :: from_utf8( & buf) . unwrap( )
2144
2147
) ;
2145
2148
} else {
2146
2149
assert_eq ! (
2147
- "[Section1]\n Key1 = Value\n Key2 = Value\n \n [Section2]\n Key1 = Value\n Key2 = Value\n " ,
2150
+ "Key1 = Value \n Key2 = Value \n \n [Section1]\n Key1 = Value\n Key2 = Value\n \n [Section2]\n Key1 = Value\n Key2 = Value\n " ,
2148
2151
str :: from_utf8( & buf) . unwrap( )
2149
2152
) ;
2150
2153
}
0 commit comments