File tree Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ autotests = false # Most tests/*.rs files are modules of tests/main.rs
19
19
20
20
[dependencies ]
21
21
apollo-parser = { path = " ../apollo-parser" , version = " 0.7.4" }
22
- ariadne = { version = " 0.3 .0" , features = [" auto-color" ] }
22
+ ariadne = { version = " 0.4 .0" , features = [" auto-color" ] }
23
23
indexmap = " 2.0.0"
24
24
rowan = " 0.15.5"
25
25
salsa = " 0.16.1"
Original file line number Diff line number Diff line change @@ -279,6 +279,8 @@ impl<'s> CliReport<'s> {
279
279
struct Cache < ' a > ( & ' a SourceMap ) ;
280
280
281
281
impl ariadne:: Cache < FileId > for Cache < ' _ > {
282
+ type Storage = String ;
283
+
282
284
fn fetch ( & mut self , file_id : & FileId ) -> Result < & ariadne:: Source , Box < dyn fmt:: Debug + ' _ > > {
283
285
struct NotFound ( FileId ) ;
284
286
impl fmt:: Debug for NotFound {
@@ -290,7 +292,7 @@ impl ariadne::Cache<FileId> for Cache<'_> {
290
292
Ok ( source_file. ariadne ( ) )
291
293
} else if * file_id == FileId :: NONE || * file_id == FileId :: HACK_TMP {
292
294
static EMPTY : OnceLock < ariadne:: Source > = OnceLock :: new ( ) ;
293
- Ok ( EMPTY . get_or_init ( || ariadne:: Source :: from ( "" ) ) )
295
+ Ok ( EMPTY . get_or_init ( || ariadne:: Source :: from ( String :: new ( ) ) ) )
294
296
} else {
295
297
Err ( Box :: new ( NotFound ( * file_id) ) )
296
298
}
Original file line number Diff line number Diff line change @@ -352,7 +352,9 @@ impl Parser {
352
352
353
353
impl MappedSource {
354
354
fn new ( input : & str ) -> Self {
355
- let ariadne = ariadne:: Source :: from ( input) ;
355
+ // FIXME This string copy is not ideal, but changing to a reference counted string affects
356
+ // public API
357
+ let ariadne = ariadne:: Source :: from ( input. to_string ( ) ) ;
356
358
357
359
let mut map = vec ! [ 0 ; input. len( ) + 1 ] ;
358
360
let mut char_index = 0 ;
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ rowan = "0.15.5"
22
22
thiserror = " 1.0.30"
23
23
24
24
[dev-dependencies ]
25
- ariadne = " 0.3 .0"
25
+ ariadne = " 0.4 .0"
26
26
indexmap = " 2.0.0"
27
27
anyhow = " 1.0.66"
28
28
pretty_assertions = " 1.3.0"
You can’t perform that action at this time.
0 commit comments