Skip to content

Commit df3f8b3

Browse files
committed
Fix some RPIT lifetime capturing issues that weren't automigrated
1 parent 8f01e48 commit df3f8b3

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

crates/client-api/src/routes/energy.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub async fn get_energy_balance<S: ControlStateDelegate>(
2222
Path(IdentityParams { identity }): Path<IdentityParams>,
2323
) -> axum::response::Result<impl IntoResponse> {
2424
let identity = Identity::from(identity);
25-
get_budget_inner(ctx, &identity).await
25+
get_budget_inner(ctx, identity).await
2626
}
2727

2828
#[serde_with::serde_as]
@@ -66,10 +66,10 @@ pub async fn add_energy<S: ControlStateDelegate>(
6666

6767
async fn get_budget_inner(
6868
ctx: impl ControlStateDelegate,
69-
identity: &Identity,
69+
identity: Identity,
7070
) -> axum::response::Result<impl IntoResponse> {
7171
let balance = ctx
72-
.get_energy_balance(identity)
72+
.get_energy_balance(&identity)
7373
.await
7474
.map_err(log_and_500)?
7575
.map_or(0, |quanta| quanta.get());

crates/commitlog/tests/streaming/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ fn repo(at: &Path) -> repo::Fs {
214214
repo::Fs::new(CommitLogDir::from_path_unchecked(at), None).unwrap()
215215
}
216216

217-
fn create_reader(path: &Path, range: impl RangeBounds<u64>) -> impl AsyncBufRead {
217+
fn create_reader<R: RangeBounds<u64>>(path: &Path, range: R) -> impl AsyncBufRead + use<R> {
218218
BufReader::new(StreamReader::new(stream::commits(
219219
repo::Fs::new(CommitLogDir::from_path_unchecked(path), None).unwrap(),
220220
range,

crates/core/src/subscription/module_subscription_manager.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,14 +1095,14 @@ impl SubscriptionManager {
10951095
fn queries_for_table_update<'a>(
10961096
&'a self,
10971097
table_update: &'a DatabaseTableUpdate,
1098-
find_rhs_val: &impl Fn(&JoinEdge, &ProductValue) -> Option<AlgebraicValue>,
1098+
find_rhs_val: impl Fn(&JoinEdge, &ProductValue) -> Option<AlgebraicValue>,
10991099
) -> impl Iterator<Item = &'a QueryHash> {
11001100
let mut queries = HashSet::new();
11011101
for hash in table_update
11021102
.inserts
11031103
.iter()
11041104
.chain(table_update.deletes.iter())
1105-
.flat_map(|row| self.queries_for_row(table_update.table_id, row, find_rhs_val))
1105+
.flat_map(|row| self.queries_for_row(table_update.table_id, row, &find_rhs_val))
11061106
{
11071107
queries.insert(hash);
11081108
}
@@ -1182,7 +1182,7 @@ impl SubscriptionManager {
11821182
.iter()
11831183
.filter(|table| !table.inserts.is_empty() || !table.deletes.is_empty())
11841184
.flat_map(|table_update| {
1185-
self.queries_for_table_update(table_update, &|edge, row| find_rhs_val(edge, row, tx))
1185+
self.queries_for_table_update(table_update, |edge, row| find_rhs_val(edge, row, tx))
11861186
})
11871187
// deduplicate queries by their hash
11881188
.filter({
@@ -2161,7 +2161,7 @@ mod tests {
21612161
};
21622162

21632163
let hashes = subscriptions
2164-
.queries_for_table_update(&table_update, &|_, _| None)
2164+
.queries_for_table_update(&table_update, |_, _| None)
21652165
.collect::<Vec<_>>();
21662166

21672167
assert!(hashes.len() == 3);
@@ -2179,7 +2179,7 @@ mod tests {
21792179
};
21802180

21812181
let hashes = subscriptions
2182-
.queries_for_table_update(&table_update, &|_, _| None)
2182+
.queries_for_table_update(&table_update, |_, _| None)
21832183
.collect::<Vec<_>>();
21842184

21852185
assert!(hashes.len() == 1);
@@ -2220,7 +2220,7 @@ mod tests {
22202220
};
22212221

22222222
let hashes = subscriptions
2223-
.queries_for_table_update(&table_update, &|_, _| None)
2223+
.queries_for_table_update(&table_update, |_, _| None)
22242224
.cloned()
22252225
.collect::<Vec<_>>();
22262226

@@ -2236,7 +2236,7 @@ mod tests {
22362236
};
22372237

22382238
let hashes = subscriptions
2239-
.queries_for_table_update(&table_update, &|_, _| None)
2239+
.queries_for_table_update(&table_update, |_, _| None)
22402240
.cloned()
22412241
.collect::<Vec<_>>();
22422242

@@ -2252,7 +2252,7 @@ mod tests {
22522252
};
22532253

22542254
let hashes = subscriptions
2255-
.queries_for_table_update(&table_update, &|_, _| None)
2255+
.queries_for_table_update(&table_update, |_, _| None)
22562256
.cloned()
22572257
.collect::<Vec<_>>();
22582258

0 commit comments

Comments
 (0)