minor clean up
This commit is contained in:
@@ -144,7 +144,6 @@ pub fn gen_to_string(fields: &Punctuated<Field, Comma>) -> TokenStream {
|
|||||||
None => continue 'fields,
|
None => continue 'fields,
|
||||||
};
|
};
|
||||||
let name_string = name.to_string();
|
let name_string = name.to_string();
|
||||||
// TODO: continue here
|
|
||||||
for attribute in attr {
|
for attribute in attr {
|
||||||
if let Attribute{ meta: Meta::Path( Path{segments, ..} ), .. } = attribute {
|
if let Attribute{ meta: Meta::Path( Path{segments, ..} ), .. } = attribute {
|
||||||
// parse nested configs or skip nonconfig elements
|
// parse nested configs or skip nonconfig elements
|
||||||
|
|||||||
+1
-2
@@ -143,14 +143,13 @@ impl Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// parse configuration file and populate config struct
|
// parse configuration file and populate config struct
|
||||||
|
// if the file is not found, navigate uses the defaults
|
||||||
if config_file.is_file() {
|
if config_file.is_file() {
|
||||||
let config_str = match fs::read_to_string(&config_file) {
|
let config_str = match fs::read_to_string(&config_file) {
|
||||||
Ok(value) => value,
|
Ok(value) => value,
|
||||||
Err(error) => return Err(error),
|
Err(error) => return Err(error),
|
||||||
};
|
};
|
||||||
_ = config.parse_from_string(&config_str);
|
_ = config.parse_from_string(&config_str);
|
||||||
} else {
|
|
||||||
// TODO: write default configuration
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if styles_as_ansi_sequences {
|
if styles_as_ansi_sequences {
|
||||||
|
|||||||
Reference in New Issue
Block a user