Skip to content

Commit 14ad2b7

Browse files
committed
Use new spanned diagnostics
1 parent c020b2d commit 14ad2b7

File tree

9 files changed

+40
-16
lines changed

9 files changed

+40
-16
lines changed

Cargo.lock

Lines changed: 29 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/mdbook-goals/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ regex = "1.11.1"
1111
rust-project-goals = { version = "0.1.0", path = "../rust-project-goals" }
1212
semver = "1.0.23"
1313
serde_json = "1.0.133"
14-
spanned = "0.4.0"

crates/mdbook-goals/src/mdbook_preprocessor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ use rust_project_goals::config::Configuration;
1212
use rust_project_goals::format_team_ask::format_team_asks;
1313
use rust_project_goals::util::{self, GithubUserInfo};
1414

15+
use rust_project_goals::spanned::Spanned;
1516
use rust_project_goals::{
1617
goal::{self, GoalDocument, Status, TeamAsk},
1718
re, team,
1819
};
19-
use spanned::Spanned;
2020

2121
const LINKS: &str = "links";
2222
const LINKIFIERS: &str = "linkifiers";

crates/rust-project-goals-cli/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ clap = { version = "4.5.23", features = ["derive"] }
1616
rust-project-goals-json = { version = "0.1.0", path = "../rust-project-goals-json" }
1717
handlebars = { version = "6.2.0", features = ["dir_source"] }
1818
comrak = "0.31.0"
19-
spanned = "0.4.0"

crates/rust-project-goals-cli/src/updates.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use chrono::{Datelike, NaiveDate};
33
use regex::Regex;
44
use rust_project_goals::markwaydown;
55
use rust_project_goals::re::{HELP_WANTED, TLDR};
6+
use rust_project_goals::spanned::{Span, Spanned};
67
use rust_project_goals::util::comma;
78
use rust_project_goals_json::GithubIssueState;
8-
use spanned::{Span, Spanned};
99
use std::io::Write;
1010
use std::path::Path;
1111
use std::process::{Command, Stdio};

crates/rust-project-goals/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ rust_team_data = { git = "https://github.com/rust-lang/team" }
1616
rust-project-goals-json = { version = "0.1.0", path = "../rust-project-goals-json" }
1717
toml = "0.8.19"
1818
indexmap = "2.7.1"
19-
spanned = "0.4.0"
19+
spanned = "0.5.0"

crates/rust-project-goals/src/goal.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,8 @@ fn extract_metadata(sections: &[Section]) -> anyhow::Result<Option<Metadata>> {
409409

410410
if !re::is_just(&re::USERNAME, poc_row[1].trim()) {
411411
anyhow::bail!(
412-
"point of contact must be a single github username (found {})",
413-
poc_row[1].render()
412+
"point of contact must be a single github username (found {:?})",
413+
poc_row[1]
414414
)
415415
}
416416

@@ -538,8 +538,8 @@ fn goal_plan(
538538
}))
539539
}
540540
_ => anyhow::bail!(
541-
"multiple goal tables found in section `{}`",
542-
section.title.render()
541+
"multiple goal tables found in section `{:?}`",
542+
section.title
543543
),
544544
}
545545
}
@@ -678,8 +678,8 @@ fn expect_headers(table: &Table, expected: &[&str]) -> anyhow::Result<()> {
678678
if table.header != expected {
679679
// FIXME: do a diff so we see which headers are missing or extraneous
680680
anyhow::bail!(
681-
"{}: unexpected table header, expected `{:?}`, found `{:?}`",
682-
table.header[0].render(),
681+
"{:?}: unexpected table header, expected `{:?}`, found `{:?}`",
682+
table.header[0],
683683
expected,
684684
table.header.iter().map(|h| &h.content),
685685
);

crates/rust-project-goals/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ pub mod markwaydown;
66
pub mod re;
77
pub mod team;
88
pub mod util;
9+
pub use spanned;

crates/rust-project-goals/src/markwaydown.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub struct Table {
3232
pub fn parse(path: impl AsRef<Path>) -> anyhow::Result<Vec<Section>> {
3333
let path = path.as_ref();
3434
let text = Spanned::read_str_from_file(path).transpose()?;
35-
parse_text(text.as_ref())
35+
parse_text(text.as_ref().map(|s| s.as_ref()))
3636
}
3737

3838
pub fn parse_text(text: Spanned<&str>) -> anyhow::Result<Vec<Section>> {

0 commit comments

Comments
 (0)