allow use to parse quoted paths (#800)

This commit is contained in:
Darren Schroeder 2022-01-21 13:20:13 -06:00 committed by GitHub
parent 939745ad67
commit 0ef0277882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -865,7 +865,9 @@ pub fn parse_use(
} else {
// TODO: Do not close over when loading module from file
// It could be a file
if let Ok(module_filename) = String::from_utf8(import_pattern.head.name) {
if let Ok(module_filename) =
String::from_utf8(trim_quotes(&import_pattern.head.name).to_vec())
{
if let Ok(module_path) = canonicalize_with(&module_filename, cwd) {
let module_name = if let Some(stem) = module_path.file_stem() {
stem.to_string_lossy().to_string()