@@ -245,39 +245,6 @@ impl<'a> Segments<'a, Path> {
245
245
246
246
Ok ( buf)
247
247
}
248
-
249
- /// Similar to `to_path_buf`, but always allows dotfiles, and reports whether
250
- /// the path contains dotfiles.
251
- pub fn to_path_buf_dotfiles ( & self ) -> Result < ( PathBuf , bool ) , PathError > {
252
- let mut buf = PathBuf :: new ( ) ;
253
- let mut is_dotfile = false ;
254
- for segment in self . clone ( ) {
255
- if segment == ".." {
256
- buf. pop ( ) ;
257
- } else if segment. starts_with ( '.' ) {
258
- buf. push ( segment) ;
259
- is_dotfile = true ;
260
- } else if segment. starts_with ( '*' ) {
261
- return Err ( PathError :: BadStart ( '*' ) )
262
- } else if segment. ends_with ( ':' ) {
263
- return Err ( PathError :: BadEnd ( ':' ) )
264
- } else if segment. ends_with ( '>' ) {
265
- return Err ( PathError :: BadEnd ( '>' ) )
266
- } else if segment. ends_with ( '<' ) {
267
- return Err ( PathError :: BadEnd ( '<' ) )
268
- } else if segment. contains ( '/' ) {
269
- return Err ( PathError :: BadChar ( '/' ) )
270
- } else if cfg ! ( windows) && segment. contains ( '\\' ) {
271
- return Err ( PathError :: BadChar ( '\\' ) )
272
- } else if cfg ! ( windows) && segment. contains ( ':' ) {
273
- return Err ( PathError :: BadChar ( ':' ) )
274
- } else {
275
- buf. push ( segment)
276
- }
277
- }
278
-
279
- Ok ( ( buf, is_dotfile) )
280
- }
281
248
}
282
249
283
250
impl < ' a > Segments < ' a , Query > {
0 commit comments