@@ -39,7 +39,7 @@ struct Column<'a> {
39
39
value : RefCell < String > ,
40
40
attr : Option < & ' a str > ,
41
41
convert : Option < & ' a str > ,
42
- search : Option < & ' a str > ,
42
+ find : Option < & ' a str > ,
43
43
replace : Option < & ' a str > ,
44
44
consol : Option < & ' a str > ,
45
45
subtable : Option < Table < ' a > >
@@ -97,7 +97,7 @@ fn gml_to_ewkb(cell: &RefCell<String>, geom: &Geometry) {
97
97
}
98
98
}
99
99
100
- fn add_table < ' a > ( rowpath : & str , outfile : Option < & str > , colspec : & ' a Vec < Yaml > ) -> Table < ' a > {
100
+ fn add_table < ' a > ( rowpath : & str , outfile : Option < & str > , colspec : & ' a [ Yaml ] ) -> Table < ' a > {
101
101
let mut table = Table :: new ( rowpath, outfile) ;
102
102
for col in colspec {
103
103
let name = col[ "name" ] . as_str ( ) . expect ( "Column has no 'name' entry in configuration file" ) ;
@@ -112,11 +112,11 @@ fn add_table<'a>(rowpath: &str, outfile: Option<&str>, colspec: &'a Vec<Yaml>) -
112
112
}
113
113
} ;
114
114
let attr = col[ "attr" ] . as_str ( ) ;
115
- let convert = col[ "convert " ] . as_str ( ) ;
116
- let search = col[ "search " ] . as_str ( ) ;
117
- let replace = col[ "replace " ] . as_str ( ) ;
118
- let consol = col[ "consol " ] . as_str ( ) ;
119
- let column = Column { name : name. to_string ( ) , path, value : RefCell :: new ( String :: new ( ) ) , attr, convert, search , replace, consol, subtable } ;
115
+ let convert = col[ "conv " ] . as_str ( ) ;
116
+ let find = col[ "find " ] . as_str ( ) ;
117
+ let replace = col[ "repl " ] . as_str ( ) ;
118
+ let consol = col[ "cons " ] . as_str ( ) ;
119
+ let column = Column { name : name. to_string ( ) , path, value : RefCell :: new ( String :: new ( ) ) , attr, convert, find , replace, consol, subtable } ;
120
120
table. columns . push ( column) ;
121
121
}
122
122
table
@@ -144,8 +144,8 @@ fn main() -> std::io::Result<()> {
144
144
let mut buf = Vec :: new ( ) ;
145
145
let mut count = 0 ;
146
146
147
- let rowpath = config[ "path" ] . as_str ( ) . expect ( "No valid 'rowpath ' entry in configuration file" ) ;
148
- let colspec = config[ "cols" ] . as_vec ( ) . expect ( "No valid 'columns ' array in configuration file" ) ;
147
+ let rowpath = config[ "path" ] . as_str ( ) . expect ( "No valid 'path ' entry in configuration file" ) ;
148
+ let colspec = config[ "cols" ] . as_vec ( ) . expect ( "No valid 'cols ' array in configuration file" ) ;
149
149
let outfile = config[ "file" ] . as_str ( ) ;
150
150
let maintable = add_table ( rowpath, outfile, colspec) ;
151
151
let mut tables: Vec < & Table > = Vec :: new ( ) ;
@@ -299,7 +299,7 @@ fn main() -> std::io::Result<()> {
299
299
if i > 0 { table. write ( "\t " ) ; }
300
300
if table. columns [ i] . value . borrow ( ) . is_empty ( ) { table. write ( "\\ N" ) ; }
301
301
else {
302
- if let ( Some ( s) , Some ( r) ) = ( table. columns [ i] . search , table. columns [ i] . replace ) {
302
+ if let ( Some ( s) , Some ( r) ) = ( table. columns [ i] . find , table. columns [ i] . replace ) {
303
303
let mut value = table. columns [ i] . value . borrow_mut ( ) ;
304
304
* value = value. replace ( s, r) ;
305
305
}
@@ -317,7 +317,7 @@ fn main() -> std::io::Result<()> {
317
317
for i in 0 ..table. columns . len ( ) {
318
318
if path == table. columns [ i] . path {
319
319
xmltotext = false ;
320
- if let ( Some ( s) , Some ( r) ) = ( table. columns [ i] . search , table. columns [ i] . replace ) {
320
+ if let ( Some ( s) , Some ( r) ) = ( table. columns [ i] . find , table. columns [ i] . replace ) {
321
321
text = text. replace ( s, r) ;
322
322
}
323
323
table. columns [ i] . value . borrow_mut ( ) . push_str ( & text) ;
0 commit comments