Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
xiyuzhai committed Nov 30, 2023
1 parent 7f3cec7 commit f4c2b39
Show file tree
Hide file tree
Showing 35 changed files with 3,140 additions and 3,698 deletions.
1 change: 1 addition & 0 deletions crates/abstractions/vec-like/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![feature(impl_trait_in_assoc_type)]
mod append_only;
pub mod error;
mod ordered_small_vec_set;
Expand Down
15 changes: 11 additions & 4 deletions crates/abstractions/vec-like/src/vec_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ pub struct VecSet<K> {
data: Vec<K>,
}

impl<'a, K> IntoIterator for &'a VecSet<K> {
type Item = &'a K;

type IntoIter = impl Iterator<Item = &'a K> + 'a;

fn into_iter(self) -> Self::IntoIter {
self.data.iter()
}
}

impl<K> VecSet<K> {
pub fn new_one_elem_set(elem: K) -> Self {
Self { data: vec![elem] }
Expand All @@ -20,10 +30,7 @@ impl<K> Default for VecSet<K> {
}
}

impl<K> Deref for VecSet<K>
where
K: PartialEq + Eq + Copy,
{
impl<K> Deref for VecSet<K> {
type Target = [K];

fn deref(&self) -> &Self::Target {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,23 @@
[
Linkage {
data: LinkageData::PathLeading {
path: Fugitive(
FugitivePath(
ItemPathId(
Id {
value: 240,
},
LinkagePantheon {
package_path: PackagePath {
toolchain: Toolchain {
data: ToolchainData::Local {
library_path: VirtualPath {
_data: RelPathBuf(
"../../../library",
),
),
),
instantiation: LinkageInstantiation {
symbol_resolutions: [],
separator: None,
},
},
},
},
Linkage {
data: LinkageData::PathLeading {
path: Fugitive(
FugitivePath(
ItemPathId(
Id {
value: 241,
},
),
name: `quick-sort`,
data: PackagePathSource::Local {
path: VirtualPath {
_data: RelPathBuf(
"../../../examples/algorithms/quick-sort",
),
),
instantiation: LinkageInstantiation {
symbol_resolutions: [],
separator: None,
},
},
},
]
instantiation_map: {},
new_linkages: [],
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
rides: VecSet {
data: [
ValkyrieRide {
linkage_path: TypeItem(
linkage_item_path: TypeItem(
TypeItemPath(
ItemPathId(
Id {
Expand All @@ -38,7 +38,7 @@
),
),
),
instantiation: HirInstantiation {
hir_instantiation: HirInstantiation {
symbol_map: [
(
Type(
Expand Down Expand Up @@ -132,7 +132,7 @@
rides: VecSet {
data: [
ValkyrieRide {
linkage_path: TypeItem(
linkage_item_path: TypeItem(
TypeItemPath(
ItemPathId(
Id {
Expand All @@ -141,7 +141,7 @@
),
),
),
instantiation: HirInstantiation {
hir_instantiation: HirInstantiation {
symbol_map: [
(
Type(
Expand Down
Loading

0 comments on commit f4c2b39

Please sign in to comment.