Skip to content

Commit 004c100

Browse files
committed
Fix some clippy warnings
1 parent 7bbf34e commit 004c100

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ struct Table<'a> {
3232
impl<'a> Table<'a> {
3333
fn new(path: &str, file: Option<&str>, filemode: &str, skip: Option<&'a str>) -> Table<'a> {
3434
let mut ownpath = String::from(path);
35-
if !ownpath.is_empty() && !ownpath.starts_with("/") { ownpath.insert(0, '/'); }
36-
if ownpath.ends_with("/") { ownpath.pop(); }
35+
if !ownpath.is_empty() && !ownpath.starts_with('/') { ownpath.insert(0, '/'); }
36+
if ownpath.ends_with('/') { ownpath.pop(); }
3737
Table {
3838
path: ownpath,
3939
file: match file {
@@ -187,9 +187,9 @@ fn add_table<'a>(rowpath: &str, outfile: Option<&str>, filemode: &str, skip: Opt
187187
let name = col["name"].as_str().unwrap_or_else(|| fatalerr!("Error: column has no 'name' entry in configuration file"));
188188
let colpath = col["path"].as_str().unwrap_or_else(|| fatalerr!("Error: column has no 'path' entry in configuration file"));
189189
let mut path = String::from(&table.path);
190-
if !colpath.is_empty() && !colpath.starts_with("/") { path.push('/'); }
190+
if !colpath.is_empty() && !colpath.starts_with('/') { path.push('/'); }
191191
path.push_str(colpath);
192-
if path.ends_with("/") { path.pop(); }
192+
if path.ends_with('/') { path.pop(); }
193193
let subtable: Option<Table> = match col["cols"].is_badvalue() {
194194
true => None,
195195
false => {

0 commit comments

Comments
 (0)