@@ -35,7 +35,7 @@ impl<'a> Table<'a> {
35
35
}
36
36
}
37
37
fn write ( & self , text : & str ) {
38
- self . file . borrow_mut ( ) . write_all ( & text. as_bytes ( ) ) . expect ( "Write error encountered; exiting..." ) ;
38
+ self . file . borrow_mut ( ) . write_all ( text. as_bytes ( ) ) . expect ( "Write error encountered; exiting..." ) ;
39
39
}
40
40
fn clear_columns ( & self ) {
41
41
for col in & self . columns {
@@ -78,7 +78,7 @@ impl Geometry {
78
78
}
79
79
}
80
80
81
- fn gml_to_ewkb ( cell : & RefCell < String > , coll : & Vec < Geometry > ) {
81
+ fn gml_to_ewkb ( cell : & RefCell < String > , coll : & [ Geometry ] ) {
82
82
let mut ewkb: Vec < u8 > = vec ! [ ] ;
83
83
84
84
if coll. len ( ) > 1 {
@@ -124,13 +124,10 @@ fn add_table<'a>(rowpath: &str, outfile: Option<&str>, filemode: &str, skip: Opt
124
124
true => None ,
125
125
false => {
126
126
let file = col[ "file" ] . as_str ( ) . expect ( "Subtable has no 'file' entry" ) ;
127
- Some ( add_table ( & path, Some ( & file) , filemode, skip, col[ "cols" ] . as_vec ( ) . expect ( "Subtable 'cols' entry is not an array" ) ) )
127
+ Some ( add_table ( & path, Some ( file) , filemode, skip, col[ "cols" ] . as_vec ( ) . expect ( "Subtable 'cols' entry is not an array" ) ) )
128
128
}
129
129
} ;
130
- let filter: Option < Regex > = match col[ "filt" ] . as_str ( ) {
131
- Some ( str) => Some ( Regex :: new ( & str) . expect ( "Invalid regex in 'filt' entry in configuration file" ) ) ,
132
- None => None
133
- } ;
130
+ let filter: Option < Regex > = col[ "filt" ] . as_str ( ) . map ( |str| Regex :: new ( str) . expect ( "Invalid regex in 'filt' entry in configuration file" ) ) ;
134
131
let attr = col[ "attr" ] . as_str ( ) ;
135
132
let convert = col[ "conv" ] . as_str ( ) ;
136
133
let find = col[ "find" ] . as_str ( ) ;
@@ -287,7 +284,7 @@ fn main() -> std::io::Result<()> {
287
284
// Handle 'subtable' case (the 'cols' entry has 'cols' of its own)
288
285
if table. columns [ i] . subtable . is_some ( ) {
289
286
tables. push ( table) ;
290
- table = & table. columns [ i] . subtable . as_ref ( ) . unwrap ( ) ;
287
+ table = table. columns [ i] . subtable . as_ref ( ) . unwrap ( ) ;
291
288
break ;
292
289
}
293
290
0 commit comments