File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,14 @@ impl ops::Deref for OsString {
173
173
}
174
174
}
175
175
176
+ #[ stable( feature = "rust1" , since = "1.9.0" ) ]
177
+ impl Default for OsString {
178
+ #[ inline]
179
+ fn default ( ) -> OsString {
180
+ OsString :: new ( )
181
+ }
182
+ }
183
+
176
184
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
177
185
impl Debug for OsString {
178
186
fn fmt ( & self , formatter : & mut fmt:: Formatter ) -> Result < ( ) , fmt:: Error > {
@@ -554,6 +562,12 @@ mod tests {
554
562
assert ! ( os_string. capacity( ) >= 33 )
555
563
}
556
564
565
+ #[ test]
566
+ fn test_os_string_default ( ) {
567
+ let os_string: OsString = Default :: default ( ) ;
568
+ assert_eq ! ( "" , & os_string) ;
569
+ }
570
+
557
571
#[ test]
558
572
fn test_os_str_is_empty ( ) {
559
573
let mut os_string = OsString :: new ( ) ;
You can’t perform that action at this time.
0 commit comments