Use Location::path_opt for checking for location path

This commit is contained in:
Jeremy Soller 2025-08-15 11:38:26 -06:00
parent 50d721479d
commit 116774d5fa
No known key found for this signature in database
GPG key ID: 670FDFB5428E05CA
2 changed files with 21 additions and 24 deletions

View file

@ -704,8 +704,8 @@ impl App {
fn search_set(&mut self, term_opt: Option<String>) -> Task<Message> {
let location_opt = match term_opt {
Some(term) => match &self.tab.location {
Location::Path(path) | Location::Search(path, ..) => Some((
Some(term) => self.tab.location.path_opt().map(|path| {
(
Location::Search(
path.to_path_buf(),
term,
@ -713,9 +713,8 @@ impl App {
Instant::now(),
),
true,
)),
_ => None,
},
)
}),
None => match &self.tab.location {
Location::Search(path, ..) => Some((Location::Path(path.to_path_buf()), false)),
_ => None,