Skip to content

Commit ece4e6b

Browse files
committed
improve names, comments
1 parent 4a4c8ed commit ece4e6b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

mdbook-goals/src/goal.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,15 @@ fn extract_plan_item(
348348
}
349349

350350
impl PlanItem {
351-
fn teams(&self) -> anyhow::Result<Vec<&'static TeamName>> {
352-
if !self.owners.contains("![Team]") {
351+
/// If true, this item is something being asked of a team.
352+
/// If false, it's something the goal owner(s) are proposing to do.
353+
fn is_team_ask(&self) -> bool {
354+
self.owners.contains("![Team]")
355+
}
356+
357+
/// Return the set of teams being asked to do things by this item, or empty vector if this is not a team ask.
358+
fn teams_being_asked(&self) -> anyhow::Result<Vec<&'static TeamName>> {
359+
if !self.is_team_ask() {
353360
return Ok(vec![]);
354361
}
355362

@@ -373,7 +380,8 @@ impl PlanItem {
373380
Ok(teams)
374381
}
375382

376-
/// Return a vector of all the team-asks from this item and its children
383+
/// Return a vector of all the team-asks from this item and its children.
384+
/// Invoked during `GoalDocument`.
377385
///
378386
/// # Parameters
379387
///
@@ -388,7 +396,7 @@ impl PlanItem {
388396
) -> anyhow::Result<Vec<TeamAsk>> {
389397
let mut asks = vec![];
390398

391-
let teams = self.teams()?;
399+
let teams = self.teams_being_asked()?;
392400
if !teams.is_empty() {
393401
asks.push(TeamAsk {
394402
link_path: link_path.clone(),

0 commit comments

Comments
 (0)