Support using attributes with either '-' or '_'

This commit is contained in:
Dheepak Krishnamurthy 2020-10-26 23:42:47 -06:00
parent d7a50ce8dc
commit f56a2388d1

View file

@ -269,6 +269,8 @@ impl TConfig {
for line in data.split('\n') { for line in data.split('\n') {
if line.starts_with(config) { if line.starts_with(config) {
return line.trim_start_matches(config).trim_start().trim_end().to_string(); return line.trim_start_matches(config).trim_start().trim_end().to_string();
} else if line.starts_with(&config.replace('-', "_")) {
return line.trim_start_matches(&config.replace('-', "_")).trim_start().trim_end().to_string();
} }
} }
"".to_string() "".to_string()