File tree Expand file tree Collapse file tree 2 files changed +13
-21
lines changed Expand file tree Collapse file tree 2 files changed +13
-21
lines changed Original file line number Diff line number Diff line change @@ -190,11 +190,9 @@ impl Stream {
190
190
. unwrap_or_else ( |_| std:: ffi:: OsString :: from ( & Ulid :: new ( ) . to_string ( ) ) )
191
191
. into_string ( )
192
192
. unwrap_or_else ( |_| Ulid :: new ( ) . to_string ( ) )
193
- . chars ( )
194
- . filter ( |c| c. is_alphanumeric ( ) || * c == '-' || * c == '_' )
195
- . collect :: < String > ( )
196
- . chars ( )
193
+ . matches ( |c : char | c. is_alphanumeric ( ) || c == '-' || c == '_' )
197
194
. collect :: < String > ( ) ;
195
+
198
196
if let Some ( id) = & self . ingestor_id {
199
197
hostname. push_str ( id) ;
200
198
}
Original file line number Diff line number Diff line change @@ -1015,25 +1015,19 @@ pub fn manifest_path(prefix: &str) -> RelativePathBuf {
1015
1015
. unwrap_or_else ( |_| std:: ffi:: OsString :: from ( & Ulid :: new ( ) . to_string ( ) ) )
1016
1016
. into_string ( )
1017
1017
. unwrap_or_else ( |_| Ulid :: new ( ) . to_string ( ) )
1018
- . chars ( )
1019
- . filter ( |c| c. is_alphanumeric ( ) || * c == '-' || * c == '_' )
1020
- . collect :: < String > ( )
1021
- . chars ( )
1018
+ . matches ( |c : char | c. is_alphanumeric ( ) || c == '-' || c == '_' )
1022
1019
. collect :: < String > ( ) ;
1023
1020
1024
- match & PARSEABLE . options . mode {
1025
- Mode :: Ingest => {
1026
- let id = INGESTOR_META
1027
- . get ( )
1028
- . unwrap_or_else ( || panic ! ( "{}" , INGESTOR_EXPECT ) )
1029
- . get_node_id ( ) ;
1021
+ if PARSEABLE . options . mode == Mode :: Ingest {
1022
+ let id = INGESTOR_META
1023
+ . get ( )
1024
+ . unwrap_or_else ( || panic ! ( "{}" , INGESTOR_EXPECT ) )
1025
+ . get_node_id ( ) ;
1030
1026
1031
- let manifest_file_name = format ! ( "ingestor.{hostname}.{id}.{MANIFEST_FILE}" ) ;
1032
- RelativePathBuf :: from_iter ( [ prefix, & manifest_file_name] )
1033
- }
1034
- _ => {
1035
- let manifest_file_name = format ! ( "{hostname}.{MANIFEST_FILE}" ) ;
1036
- RelativePathBuf :: from_iter ( [ prefix, & manifest_file_name] )
1037
- }
1027
+ let manifest_file_name = format ! ( "ingestor.{hostname}.{id}.{MANIFEST_FILE}" ) ;
1028
+ RelativePathBuf :: from_iter ( [ prefix, & manifest_file_name] )
1029
+ } else {
1030
+ let manifest_file_name = format ! ( "{hostname}.{MANIFEST_FILE}" ) ;
1031
+ RelativePathBuf :: from_iter ( [ prefix, & manifest_file_name] )
1038
1032
}
1039
1033
}
You can’t perform that action at this time.
0 commit comments