-
Notifications
You must be signed in to change notification settings - Fork 972
Closed
Labels
good first issueIssues up for grabs, also good candidates for new rustfmt contributorsIssues up for grabs, also good candidates for new rustfmt contributors
Description
See here:
Lines 215 to 221 in 4449250
| pub(crate) fn load_and_compile_template(path: &str) -> Result<Regex, LicenseError> { | |
| let mut lt_file = File::open(&path)?; | |
| let mut lt_str = String::new(); | |
| lt_file.read_to_string(&mut lt_str)?; | |
| let lt_parsed = TemplateParser::parse(<_str)?; | |
| Ok(Regex::new(<_parsed)?) | |
| } |
Nothing upstream of this function aborts if license_template_path is the empty string.
One might wonder why anyone would set license_template_path to "". Well, rls does it when it creates a rustfmt Config using Default::default(), serializes it to file, and passes it as an argument via --config-path. This inevitably results in:
Warning for license template file "": No such file or directory (os error 2)
It would be nice to avoid this.
Metadata
Metadata
Assignees
Labels
good first issueIssues up for grabs, also good candidates for new rustfmt contributorsIssues up for grabs, also good candidates for new rustfmt contributors