File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ use crate::emitter::EmitterFactory;
2
2
use crate :: graph_fs:: DenoGraphFsAdapter ;
3
3
use crate :: jsr:: CliJsrUrlProvider ;
4
4
use crate :: resolver:: CliGraphResolver ;
5
- use anyhow:: Context ;
5
+ use anyhow:: { anyhow , Context } ;
6
6
use deno_core:: error:: { custom_error, AnyError } ;
7
7
use deno_core:: parking_lot:: Mutex ;
8
8
use deno_core:: { FastString , ModuleSpecifier } ;
@@ -413,10 +413,9 @@ pub async fn create_graph(
413
413
specifier
414
414
} else {
415
415
let binding = std:: fs:: canonicalize ( & file) . context ( "failed to read path" ) ?;
416
- let specifier = binding. to_str ( ) . context ( "failed to convert path to str" ) ?;
417
- let format_specifier = format ! ( "file:///{}" , specifier) ;
418
416
419
- ModuleSpecifier :: parse ( & format_specifier) . context ( "failed to parse specifier" ) ?
417
+ ModuleSpecifier :: from_file_path ( binding)
418
+ . map_err ( |_| anyhow ! ( "failed to parse specifier" ) ) ?
420
419
} ;
421
420
422
421
let builder = ModuleGraphBuilder :: new ( emitter_factory, false ) ;
You can’t perform that action at this time.
0 commit comments