Skip to content

Commit 4779115

Browse files
svc-secopsrenovate[bot]goto-bus-stop
authored
chore(deps): update rust crate ariadne to 0.4.0 (#793)
* chore(deps): update rust crate ariadne to 0.4.0 * Specify ariadne storage type --------- Co-authored-by: renovate[bot] <[email protected]> Co-authored-by: Renée Kooi <[email protected]>
1 parent 98dfb20 commit 4779115

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

crates/apollo-compiler/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ autotests = false # Most tests/*.rs files are modules of tests/main.rs
1919

2020
[dependencies]
2121
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"] }
2323
indexmap = "2.0.0"
2424
rowan = "0.15.5"
2525
salsa = "0.16.1"

crates/apollo-compiler/src/diagnostic.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ impl<'s> CliReport<'s> {
279279
struct Cache<'a>(&'a SourceMap);
280280

281281
impl ariadne::Cache<FileId> for Cache<'_> {
282+
type Storage = String;
283+
282284
fn fetch(&mut self, file_id: &FileId) -> Result<&ariadne::Source, Box<dyn fmt::Debug + '_>> {
283285
struct NotFound(FileId);
284286
impl fmt::Debug for NotFound {
@@ -290,7 +292,7 @@ impl ariadne::Cache<FileId> for Cache<'_> {
290292
Ok(source_file.ariadne())
291293
} else if *file_id == FileId::NONE || *file_id == FileId::HACK_TMP {
292294
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())))
294296
} else {
295297
Err(Box::new(NotFound(*file_id)))
296298
}

crates/apollo-compiler/src/parser.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,9 @@ impl Parser {
352352

353353
impl MappedSource {
354354
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());
356358

357359
let mut map = vec![0; input.len() + 1];
358360
let mut char_index = 0;

crates/apollo-parser/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ rowan = "0.15.5"
2222
thiserror = "1.0.30"
2323

2424
[dev-dependencies]
25-
ariadne = "0.3.0"
25+
ariadne = "0.4.0"
2626
indexmap = "2.0.0"
2727
anyhow = "1.0.66"
2828
pretty_assertions = "1.3.0"

0 commit comments

Comments
 (0)