From 4aa453daf93c606197c9173b007ed5b63331a7ee Mon Sep 17 00:00:00 2001 From: mnmaita <47983254+mnmaita@users.noreply.github.com> Date: Fri, 9 Oct 2026 23:43:30 +0200 Subject: [PATCH 1/2] Migrates to serde-saphyr --- tools/export-content/Cargo.toml | 4 +++- tools/export-content/src/app.rs | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/export-content/Cargo.toml b/tools/export-content/Cargo.toml index cf33ff0df0a7b..44a4d2b70e95d 100644 --- a/tools/export-content/Cargo.toml +++ b/tools/export-content/Cargo.toml @@ -9,7 +9,9 @@ miette = { version = "7.6.0", features = ["fancy"] } ratatui = "0.30.0" regex = "1.11.1" serde = { version = "1.0", features = ["derive"] } -serde_yml = "0.0.12" +serde-saphyr = { version = "1", default-features = false, features = [ + "deserialize", +] } thiserror = "2.0.12" [lints] diff --git a/tools/export-content/src/app.rs b/tools/export-content/src/app.rs index dc0d70935b9e4..4b4056cfcbc13 100644 --- a/tools/export-content/src/app.rs +++ b/tools/export-content/src/app.rs @@ -345,14 +345,16 @@ fn load_content(dir: PathBuf, kind: &'static str) -> Result> { ))?; let frontmatter = caps.name("frontmatter").unwrap().as_str(); - let metadata = serde_yml::from_str::(frontmatter).map_err(|e| ParseError { + let metadata = serde_saphyr::from_str::(frontmatter).map_err(|e| ParseError { src: NamedSource::new( format!("{}", dir_entry.path().display()), frontmatter.to_owned(), ), kind, file_name, - err_span: e.location().map(|l| l.index()), + err_span: e + .location() + .and_then(|l| l.span().byte_offset().map(|offset| offset as usize)), error: e, })?; let content = caps.name("content").unwrap().as_str().to_owned(); @@ -372,5 +374,5 @@ pub struct ParseError { file_name: String, #[label("{error}")] err_span: Option, - error: serde_yml::Error, + error: serde_saphyr::Error, } From b3f14bddca2c6fec5083c0ab2dbdb38e5533d8cb Mon Sep 17 00:00:00 2001 From: mnmaita <47983254+mnmaita@users.noreply.github.com> Date: Sat, 10 Oct 2026 00:37:46 +0200 Subject: [PATCH 2/2] Run taplo fmt --- tools/export-content/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/export-content/Cargo.toml b/tools/export-content/Cargo.toml index 44a4d2b70e95d..86e979054c204 100644 --- a/tools/export-content/Cargo.toml +++ b/tools/export-content/Cargo.toml @@ -10,7 +10,7 @@ ratatui = "0.30.0" regex = "1.11.1" serde = { version = "1.0", features = ["derive"] } serde-saphyr = { version = "1", default-features = false, features = [ - "deserialize", + "deserialize", ] } thiserror = "2.0.12"