@@ -24,20 +24,6 @@ mod private
2424   /// If you want to match against this expression, use `PATH_ITEM_REGEX`. 
2525   pub  const  PATH_ITEM_REGEX_STR  :  & str  = r"[a-zA-Z0-9_ -]+" ; 
2626
27-   /// Regular expression for `Path` items. You can match whole `&str` with this type. 
28-    /// 
29-    /// To match whole `Path` in strings, use `PATH_REGEX`. 
30-    pub  static  PATH_ITEM_REGEX  :  LazyLock <  Regex  >  = LazyLock :: new (  ||
31-   { 
32-     let  regex = format ! 
33-     ( 
34-       r"^{}$" , 
35-       PATH_ITEM_REGEX_STR 
36-     ) ; 
37- 
38-     Regex :: new (  & regex ) . unwrap ( ) 
39-   } ) ; 
40- 
4127  /// Regular expression for `Path`. You can match whole `&str` with this type. 
4228   pub  static  PATH_REGEX  :  LazyLock <  Regex  >  = LazyLock :: new (  || 
4329  { 
@@ -148,54 +134,6 @@ mod private
148134      self . 0 
149135    } 
150136
151-     /// Creates a relative `Path` from an iterator over items that implement `AsRef<str>`. 
152-      /// To create an absolute `Path`, use `from_iter_abs` method. 
153-      /// 
154-      /// Returns `Err(io::Error)` if the items are not valid `Path` items. 
155-      pub  fn  from_iter_rel <  ' a  > (  iter  :  impl  Iterator <  Item  = & ' a  str  >  )  -> Result <  Self ,  io:: Error  > 
156-     { 
157-       iter. map (  | path_element_str |
158-       { 
159-         if  PATH_ITEM_REGEX . is_match (  path_element_str ) 
160-         { 
161-           Ok  (  path_element_str ) 
162-         } 
163-         else 
164-         { 
165-           Err  (  io:: Error :: from (  io:: ErrorKind :: InvalidData  )  ) 
166-         } 
167-       } ) 
168-       . process_results (  | mut  item_iter |
169-       { 
170-         Self (  item_iter. join (  PATH_SEPARATOR  )  ) 
171-       } ) 
172-     } 
173- 
174-     /// Creates an absolute `Path` from an iterator over strings. 
175-      /// To create a relative `Path`, use `from_iter_rel` method. 
176-      /// 
177-      /// Returns `Err(io::Error)` if the items are not valid `Path` items. 
178-      pub  fn  from_iter_abs <  ' a  > (  iter  :  impl  Iterator <  Item  = & ' a  str  >  )  -> Result <  Self ,  io:: Error  > 
179-     { 
180-       iter. map (  | path_element_str |
181-       { 
182-         if  PATH_ITEM_REGEX . is_match (  path_element_str ) 
183-         { 
184-           Ok  (  path_element_str ) 
185-         } 
186-         else 
187-         { 
188-           Err  (  io:: Error :: from (  io:: ErrorKind :: InvalidData  )  ) 
189-         } 
190-       } ) 
191-       . process_results (  | mut  item_iter |
192-       { 
193-         let  mut  res = item_iter. join (  PATH_SEPARATOR  ) ; 
194-         res. insert_str (  0 ,  PATH_SEPARATOR  ) ; 
195-         Self (  res ) 
196-       } ) 
197-     } 
198- 
199137    /// Iterate over components of a `Path`. If the `Path` is absolute, then the first 
200138     /// element will be `::`. 
201139     pub  fn  components (  & self  )  -> impl  Iterator <  Item  = & str  > 
0 commit comments