@@ -9,7 +9,7 @@ pub(crate) trait Sealed {
99 function : impl FnOnce ( * const u16 ) -> Result < R , crate :: Error > ,
1010 ) -> Result < R , crate :: Error > ;
1111
12- #[ cfg( unix) ]
12+ #[ cfg( any ( unix, target_os = "motor" ) ) ]
1313 #[ doc( hidden) ]
1414 fn posix_filename < R > (
1515 self ,
@@ -39,7 +39,7 @@ impl Sealed for &str {
3939 function ( utf16. as_ptr ( ) )
4040 }
4141
42- #[ cfg( unix) ]
42+ #[ cfg( any ( unix, target_os = "motor" ) ) ]
4343 fn posix_filename < R > (
4444 self ,
4545 function : impl FnOnce ( * const core:: ffi:: c_char ) -> Result < R , Error > ,
@@ -63,7 +63,7 @@ impl Sealed for &String {
6363 self . as_str ( ) . windows_filename ( function)
6464 }
6565
66- #[ cfg( unix) ]
66+ #[ cfg( any ( unix, target_os = "motor" ) ) ]
6767 fn posix_filename < R > (
6868 self ,
6969 function : impl FnOnce ( * const core:: ffi:: c_char ) -> Result < R , Error > ,
@@ -82,7 +82,7 @@ impl Sealed for String {
8282 self . as_str ( ) . windows_filename ( function)
8383 }
8484
85- #[ cfg( unix) ]
85+ #[ cfg( any ( unix, target_os = "motor" ) ) ]
8686 fn posix_filename < R > (
8787 mut self ,
8888 function : impl FnOnce ( * const core:: ffi:: c_char ) -> Result < R , Error > ,
@@ -120,12 +120,12 @@ mod std {
120120 function ( utf16. as_ptr ( ) )
121121 }
122122
123- #[ cfg( unix) ]
123+ #[ cfg( any ( unix, target_os = "motor" ) ) ]
124124 fn posix_filename < R > (
125125 self ,
126126 function : impl FnOnce ( * const core:: ffi:: c_char ) -> Result < R , Error > ,
127127 ) -> Result < R , Error > {
128- let bytes = std :: os :: unix :: ffi :: OsStrExt :: as_bytes ( self ) ;
128+ let bytes = self . as_encoded_bytes ( ) ;
129129 if crate :: util:: check_null_bytes ( bytes) ? {
130130 function ( bytes. as_ptr ( ) . cast ( ) )
131131 } else {
@@ -145,7 +145,7 @@ mod std {
145145 self . as_os_str ( ) . windows_filename ( function)
146146 }
147147
148- #[ cfg( unix) ]
148+ #[ cfg( any ( unix, target_os = "motor" ) ) ]
149149 fn posix_filename < R > (
150150 self ,
151151 function : impl FnOnce ( * const core:: ffi:: c_char ) -> Result < R , Error > ,
@@ -168,12 +168,12 @@ mod std {
168168 self . as_os_str ( ) . windows_filename ( function)
169169 }
170170
171- #[ cfg( unix) ]
171+ #[ cfg( any ( unix, target_os = "motor" ) ) ]
172172 fn posix_filename < R > (
173173 self ,
174174 function : impl FnOnce ( * const core:: ffi:: c_char ) -> Result < R , Error > ,
175175 ) -> Result < R , Error > {
176- let mut bytes = std :: os :: unix :: ffi :: OsStringExt :: into_vec ( self ) ;
176+ let mut bytes = self . into_encoded_bytes ( ) ;
177177 if crate :: util:: check_null_bytes ( & bytes) ? {
178178 function ( bytes. as_ptr ( ) . cast ( ) )
179179 } else {
@@ -193,7 +193,7 @@ mod std {
193193 self . into_os_string ( ) . windows_filename ( function)
194194 }
195195
196- #[ cfg( unix) ]
196+ #[ cfg( any ( unix, target_os = "motor" ) ) ]
197197 fn posix_filename < R > (
198198 self ,
199199 function : impl FnOnce ( * const core:: ffi:: c_char ) -> Result < R , Error > ,
@@ -212,7 +212,7 @@ mod std {
212212 self . as_os_str ( ) . windows_filename ( function)
213213 }
214214
215- #[ cfg( unix) ]
215+ #[ cfg( any ( unix, target_os = "motor" ) ) ]
216216 fn posix_filename < R > (
217217 self ,
218218 function : impl FnOnce ( * const core:: ffi:: c_char ) -> Result < R , Error > ,
@@ -231,7 +231,7 @@ mod std {
231231 self . as_os_str ( ) . windows_filename ( function)
232232 }
233233
234- #[ cfg( unix) ]
234+ #[ cfg( any ( unix, target_os = "motor" ) ) ]
235235 fn posix_filename < R > (
236236 self ,
237237 function : impl FnOnce ( * const core:: ffi:: c_char ) -> Result < R , Error > ,
0 commit comments