mirror of
https://github.com/lexmount/moli.git
synced 2026-11-24 08:02:58 +00:00
refactor(navigation): trim traversal seed candidates
This commit is contained in:
@@ -67,7 +67,7 @@ pub(crate) struct PendingLocationNavigation {
|
||||
pub(crate) initial_document_environment:
|
||||
Option<crate::runtime::RendererCapturedDocumentEnvironment>,
|
||||
pub(crate) entry_seed: Option<NavigationHistoryEntrySeed>,
|
||||
/// Applied by the renderer when it owns the followed navigation.
|
||||
/// Resolved history handling for requests without a prebuilt entry seed.
|
||||
pub(crate) history_mutation: Option<NavigationHistoryMutation>,
|
||||
pub(crate) reserved_service_worker_client: Option<PendingReservedServiceWorkerClient>,
|
||||
pub(crate) service_worker_client_navigate:
|
||||
|
||||
@@ -79,7 +79,6 @@ pub struct NavigationActivationSeed {
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct NavigationTraversalSeedCandidate {
|
||||
pub current_url: Url,
|
||||
pub target_url: Url,
|
||||
pub seed: NavigationHistoryEntrySeed,
|
||||
}
|
||||
@@ -448,11 +447,9 @@ pub fn traversal_navigation_seed_candidate(
|
||||
return None;
|
||||
}
|
||||
|
||||
let current_url = Url::parse(¤t_entry.url).ok()?;
|
||||
let target_url = Url::parse(&target_entry.url).ok()?;
|
||||
Some(NavigationTraversalSeedCandidate {
|
||||
current_url,
|
||||
target_url: target_url.clone(),
|
||||
target_url,
|
||||
seed: NavigationHistoryEntrySeed {
|
||||
session_history: crate::SessionHistorySeed {
|
||||
commit: crate::SessionHistoryCommit::Traverse,
|
||||
@@ -948,10 +945,6 @@ mod tests {
|
||||
|
||||
let candidate =
|
||||
traversal_navigation_seed_candidate(entries, 0, 1).expect("traversal candidate");
|
||||
assert_eq!(
|
||||
candidate.current_url.as_str(),
|
||||
"https://example.test/current"
|
||||
);
|
||||
assert_eq!(candidate.target_url.as_str(), "https://example.test/target");
|
||||
assert_eq!(candidate.seed.current_index, 1);
|
||||
assert_eq!(
|
||||
|
||||
Reference in New Issue
Block a user