Skip to content

Commit 75b1360

Browse files
committed
Add temp_cache to CI and fix typesize
1 parent 5affbae commit 75b1360

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ jobs:
8888
- builder without model
8989
- unstable + typesize
9090
- unstable (no default features)
91+
- temp cache
92+
- temp cache + typesize
9193

9294
include:
9395
- name: builder without model
@@ -96,6 +98,10 @@ jobs:
9698
features: default unstable typesize
9799
- name: unstable (no default features)
98100
features: unstable
101+
- name: temp cache
102+
features: default temp_cache
103+
- name: temp cache + typesize
104+
features: default temp_cache typesize
99105

100106
steps:
101107
- name: Checkout sources

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ chrono = ["dep:chrono", "typesize?/chrono"]
130130
full = ["default", "collector", "voice", "voice_model", "interactions_endpoint"]
131131

132132
# Enables temporary caching in functions that retrieve data via the HTTP API.
133-
temp_cache = ["cache", "mini-moka", "typesize?/mini_moka"]
133+
temp_cache = ["cache", "mini-moka", "typesize?/mini_moka", "typesize?/dashmap"]
134134

135135
typesize = ["dep:typesize", "dashmap/typesize", "small-fixed-array/typesize", "bool_to_bitflags/typesize", "extract_map/typesize"]
136136

src/cache/wrappers.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub(crate) struct MaybeOwnedArc<T>(
123123
#[cfg(feature = "temp_cache")]
124124
impl<T> MaybeOwnedArc<T> {
125125
pub(crate) fn new(inner: T) -> Self {
126-
Self(Arc::new(inner))
126+
Self(Arc::new(inner).into())
127127
}
128128

129129
pub(crate) fn get_inner(self) -> Arc<T> {
@@ -142,8 +142,10 @@ impl<T: typesize::TypeSize> typesize::TypeSize for MaybeOwnedArc<T> {
142142
self.0.extra_size()
143143
}
144144

145-
fn get_collection_item_count(&self) -> Option<usize> {
146-
self.0.get_collection_item_count()
145+
typesize::if_typesize_details! {
146+
fn get_collection_item_count(&self) -> Option<usize> {
147+
self.0.get_collection_item_count()
148+
}
147149
}
148150
}
149151

@@ -159,6 +161,6 @@ impl<T> std::ops::Deref for MaybeOwnedArc<T> {
159161
#[cfg(feature = "temp_cache")]
160162
impl<T> Clone for MaybeOwnedArc<T> {
161163
fn clone(&self) -> Self {
162-
Self(Arc::clone(&self.0))
164+
Self(self.0.clone().into())
163165
}
164166
}

0 commit comments

Comments
 (0)