summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-10-15 08:49:06 +0300
committerLars Wirzenius <liw@liw.fi>2022-10-15 08:49:06 +0300
commit43db70972aa35352e728114ae6cf1ff30e2e6f64 (patch)
tree7447e04d4e27a5e2179c55db5b92d775a432c191
parent8d97f2f519fb6783be53cf8d074d577080ef768f (diff)
downloadriki-43db70972aa35352e728114ae6cf1ff30e2e6f64.tar.gz
refactor: rename page_queue to pages_that_will_exist
The new name describes the intent of the field better. Sponsored-by: author
-rw-r--r--src/site.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/site.rs b/src/site.rs
index fc2061a..a6f3184 100644
--- a/src/site.rs
+++ b/src/site.rs
@@ -19,7 +19,7 @@ pub struct Site {
wikitext_pages: Vec<WikitextPage>,
markdown_pages: Vec<MarkdownPage>,
name_queue: BinaryHeap<Name>,
- page_queue: PageSet,
+ pages_that_will_exist: PageSet,
files: Names,
}
@@ -38,7 +38,7 @@ impl Site {
files: Names::default(),
patterns: TokenPatterns::default(),
name_queue: BinaryHeap::new(),
- page_queue: PageSet::default(),
+ pages_that_will_exist: PageSet::default(),
whatchanged: HashMap::new(),
shortcuts: HashMap::new(),
}
@@ -64,7 +64,7 @@ impl Site {
fn add_wikitextpage(&mut self, page: WikitextPage) {
info!("add wikitext page {}", page.meta().path().display());
- self.page_queue.insert(&page);
+ self.pages_that_will_exist.insert(&page);
self.wikitext_pages.push(page);
}
@@ -213,7 +213,7 @@ impl Site {
// Is target absolute?
if target.starts_with("/") {
- if let Some(path) = self.page_queue.get(target) {
+ if let Some(path) = self.pages_that_will_exist.get(target) {
trace!("absolute target exists");
return Ok(path.into());
} else {
@@ -225,7 +225,7 @@ impl Site {
// Does a sub-page or file exist?
let wanted = page.join(target);
trace!("checking for subpage or file {}", wanted.display());
- if let Some(path) = self.page_queue.get(&wanted) {
+ if let Some(path) = self.pages_that_will_exist.get(&wanted) {
trace!("subpage exists: {}", path.display());
return Ok(path.into());
} else if self.file_exists(&wanted) {
@@ -241,7 +241,7 @@ impl Site {
parent.display(),
path.display()
);
- if let Some(path) = self.page_queue.get(path.as_path()) {
+ if let Some(path) = self.pages_that_will_exist.get(path.as_path()) {
trace!("sibling page exists: {}", path.display());
return Ok(path.into());
}
@@ -255,7 +255,7 @@ impl Site {
// Does target exist relative to root?
let wanted = Path::new("/").join(target);
trace!("checking for absolute path {}", wanted.display());
- if let Some(path) = self.page_queue.get(&wanted) {
+ if let Some(path) = self.pages_that_will_exist.get(&wanted) {
trace!("page at absolute path exists: {}", path.display());
return Ok(path.into());
} else if self.file_exists(&wanted) {