Skip to content

Commit

Permalink
Minor style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
laurmaedje committed Dec 14, 2023
1 parent af711c9 commit f1ed1e5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion macros/src/memoize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fn process(function: &Function) -> Result<TokenStream> {
#output,
> = ::comemo::internal::Cache::new(|| {
::comemo::internal::register_evictor(|max_age| __CACHE.evict(max_age));
::std::default::Default::default()
::core::default::Default::default()
});

#(#bounds;)*
Expand Down
2 changes: 1 addition & 1 deletion macros/src/track.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ fn create_variants(methods: &[Method]) -> TokenStream {
enum __ComemoVariant {
#(#variants,)*
}

}
}

Expand Down Expand Up @@ -291,6 +290,7 @@ fn create(
} else {
quote! { MutableConstraint }
};

Ok(quote! {
impl #impl_params ::comemo::Track for #ty #where_clause {}

Expand Down
14 changes: 7 additions & 7 deletions src/constraint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ impl<T: Call> MutableConstraint<T> {
where
F: FnMut(&T),
{
for call in &self.0.read().0 {
if call.call.is_mutable() {
f(&call.call);
for entry in &self.0.read().0 {
if entry.call.is_mutable() {
f(&entry.call);
}
}
}
Expand Down Expand Up @@ -245,8 +245,8 @@ impl<T: Call> Join for ImmutableConstraint<T> {
#[inline]
fn join(&self, inner: &Self) {
let mut this = self.0.write();
for call in inner.0.read().0.values() {
this.push_inner(Cow::Borrowed(call));
for entry in inner.0.read().0.values() {
this.push_inner(Cow::Borrowed(entry));
}
}

Expand All @@ -260,8 +260,8 @@ impl<T: Call> Join for MutableConstraint<T> {
#[inline]
fn join(&self, inner: &Self) {
let mut this = self.0.write();
for call in inner.0.read().0.iter() {
this.push_inner(Cow::Borrowed(call));
for entry in inner.0.read().0.iter() {
this.push_inner(Cow::Borrowed(entry));
}
}

Expand Down

0 comments on commit f1ed1e5

Please sign in to comment.