mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-10 05:37:29 +03:00
Properly handle WorktreeId
This commit is contained in:
parent
34b0d6200f
commit
3984cc6d39
@ -265,7 +265,7 @@ impl PickerDelegate for FileFinderDelegate {
|
||||
.map(|(i, history_item)| PathMatch {
|
||||
score: i as f64,
|
||||
positions: Vec::new(),
|
||||
worktree_id: history_item.worktree_id.0,
|
||||
worktree_id: history_item.worktree_id.to_usize(),
|
||||
path: Arc::clone(&history_item.path),
|
||||
path_prefix: "".into(),
|
||||
distance_to_relative_ancestor: usize::MAX,
|
||||
@ -870,7 +870,7 @@ mod tests {
|
||||
let worktree_id = cx.read(|cx| {
|
||||
let worktrees = workspace.read(cx).worktrees(cx).collect::<Vec<_>>();
|
||||
assert_eq!(worktrees.len(), 1);
|
||||
WorktreeId(worktrees[0].id())
|
||||
WorktreeId::from_usize(worktrees[0].id())
|
||||
});
|
||||
|
||||
// When workspace has an active item, sort items which are closer to that item
|
||||
@ -975,7 +975,7 @@ mod tests {
|
||||
let worktree_id = cx.read(|cx| {
|
||||
let worktrees = workspace.read(cx).worktrees(cx).collect::<Vec<_>>();
|
||||
assert_eq!(worktrees.len(), 1);
|
||||
WorktreeId(worktrees[0].id())
|
||||
WorktreeId::from_usize(worktrees[0].id())
|
||||
});
|
||||
|
||||
// Open and close panels, getting their history items afterwards.
|
||||
|
@ -58,7 +58,7 @@ use sum_tree::{Bias, Edit, SeekTarget, SumTree, TreeMap, TreeSet};
|
||||
use util::{paths::HOME, ResultExt, TakeUntilExt, TryFutureExt};
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash, PartialOrd, Ord)]
|
||||
pub struct WorktreeId(pub usize);
|
||||
pub struct WorktreeId(usize);
|
||||
|
||||
pub enum Worktree {
|
||||
Local(LocalWorktree),
|
||||
|
Loading…
Reference in New Issue
Block a user