8000 [pull] main from can1357:main by pull[bot] · Pull Request #118 · ericrihm/oh-my-pi · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion crates/pi-edit/src/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl FileCache {
/// reads made for it.
pub fn provide(&mut self, url: String, resolution: UrlResolution) {
let policy = &self.policy;
let names_url = |authored: &str| policy.url_target(authored) == Some(url.as_str());
let names_url = |authored: &str| policy.url_target(authored).as_deref() == Some(url.as_str());
self
.resolutions
.retain(|(authored, _), _| !names_url(authored));
Expand All @@ -150,6 +150,15 @@ impl FileCache {
std::mem::take(&mut self.unresolved)
}

/// Drop every host URL answer and recorded miss, plus every cached read
/// and resolution (some were made from those answers), so URL targets ask
/// the host again.
pub fn forget_urls(&mut self) {
self.clear();
self.urls.clear();
self.unresolved.clear();
}

/// Plan-mode write guard, judging URL targets by their host answers.
///
/// # Errors
Expand Down
Loading
Loading
0