Skip to content

Commit d52634d

Browse files
committed
Fix warnings
1 parent ed65af1 commit d52634d

File tree

8 files changed

+17
-29
lines changed

8 files changed

+17
-29
lines changed

crates/corro-agent/src/api/public/mod.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -704,16 +704,14 @@ pub async fn api_v1_table_stats(
704704

705705
#[cfg(test)]
706706
mod tests {
707-
use bytes::Bytes;
708707
use corro_types::{
709708
api::RowId,
710709
base::CrsqlDbVersion,
711710
broadcast::{BroadcastInput, BroadcastV1, ChangeV1, Changeset},
712711
config::Config,
713712
schema::SqliteType,
714713
};
715-
use futures::Stream;
716-
use http_body::{combinators::UnsyncBoxBody, Body};
714+
use http_body::Body;
717715
use tokio::sync::mpsc::error::TryRecvError;
718716
use tokio_util::codec::{Decoder, LinesCodec};
719717
use tripwire::Tripwire;
@@ -722,19 +720,6 @@ mod tests {
722720

723721
use crate::agent::setup;
724722

725-
struct UnsyncBodyStream(std::pin::Pin<Box<UnsyncBoxBody<Bytes, axum::Error>>>);
726-
727-
impl Stream for UnsyncBodyStream {
728-
type Item = Result<Bytes, axum::Error>;
729-
730-
fn poll_next(
731-
mut self: std::pin::Pin<&mut Self>,
732-
cx: &mut std::task::Context<'_>,
733-
) -> std::task::Poll<Option<Self::Item>> {
734-
self.0.as_mut().poll_data(cx)
735-
}
736-
}
737-
738723
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
739724
async fn test_api_db_execute() -> eyre::Result<()> {
740725
_ = tracing_subscriber::fmt::try_init();

crates/corro-api-types/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ impl SqliteValue {
511511
}
512512
}
513513

514-
pub fn as_ref(&self) -> SqliteValueRef {
514+
pub fn as_ref(&self) -> SqliteValueRef<'_> {
515515
match self {
516516
SqliteValue::Null => SqliteValueRef(ValueRef::Null),
517517
SqliteValue::Integer(i) => SqliteValueRef(ValueRef::Integer(*i)),

crates/corro-pg/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2554,7 +2554,7 @@ enum ParamKind<'a> {
25542554
Positional,
25552555
}
25562556

2557-
fn as_param(expr: &Expr) -> Option<ParamKind> {
2557+
fn as_param(expr: &Expr) -> Option<ParamKind<'_>> {
25582558
if let Expr::Variable(name) = expr {
25592559
if name.is_empty() {
25602560
Some(ParamKind::Positional)
@@ -2595,7 +2595,7 @@ enum SqliteName {
25952595
DoublyQualified(Name, Name, Name),
25962596
}
25972597

2598-
fn expr_to_name(expr: &Expr) -> Option<SqliteNameRef> {
2598+
fn expr_to_name(expr: &Expr) -> Option<SqliteNameRef<'_>> {
25992599
match expr {
26002600
Expr::Id(id) => Some(SqliteNameRef::Id(id)),
26012601
Expr::Name(name) => Some(SqliteNameRef::Name(name)),

crates/corro-types/src/agent.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,23 +1578,23 @@ impl Bookie {
15781578
&self,
15791579
label: &'static str,
15801580
extra: E,
1581-
) -> CountedTokioRwLockReadGuard<BookieInner> {
1581+
) -> CountedTokioRwLockReadGuard<'_, BookieInner> {
15821582
self.0.read(label, extra).await
15831583
}
15841584

15851585
pub async fn write<C: fmt::Display, E: Into<Option<C>>>(
15861586
&self,
15871587
label: &'static str,
15881588
extra: E,
1589-
) -> CountedTokioRwLockWriteGuard<BookieInner> {
1589+
) -> CountedTokioRwLockWriteGuard<'_, BookieInner> {
15901590
self.0.write(label, extra).await
15911591
}
15921592

15931593
pub fn blocking_write<C: fmt::Display, E: Into<Option<C>>>(
15941594
&self,
15951595
label: &'static str,
15961596
extra: E,
1597-
) -> CountedTokioRwLockWriteGuard<BookieInner> {
1597+
) -> CountedTokioRwLockWriteGuard<'_, BookieInner> {
15981598
self.0.blocking_write(label, extra)
15991599
}
16001600

crates/corro-types/src/pubsub.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ impl Handle for MatcherHandle {
278278
self.inner.id
279279
}
280280

281-
fn cancelled(&self) -> WaitForCancellationFuture {
281+
fn cancelled(&self) -> WaitForCancellationFuture<'_> {
282282
self.inner.cancel.cancelled()
283283
}
284284

@@ -2393,7 +2393,7 @@ pub enum UnpackError {
23932393
Misuse,
23942394
}
23952395

2396-
pub fn unpack_columns(mut buf: &[u8]) -> Result<Vec<SqliteValueRef>, UnpackError> {
2396+
pub fn unpack_columns(mut buf: &[u8]) -> Result<Vec<SqliteValueRef<'_>>, UnpackError> {
23972397
let mut ret = vec![];
23982398
let num_columns = buf.get_u8();
23992399

crates/corro-types/src/sqlite.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl CrConn {
7272
Ok(Self(conn))
7373
}
7474

75-
pub fn immediate_transaction(&mut self) -> rusqlite::Result<Transaction> {
75+
pub fn immediate_transaction(&mut self) -> rusqlite::Result<Transaction<'_>> {
7676
self.0
7777
.transaction_with_behavior(rusqlite::TransactionBehavior::Immediate)
7878
}

crates/corro-types/src/updates.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub trait Manager<H> {
3535
#[async_trait]
3636
pub trait Handle {
3737
fn id(&self) -> Uuid;
38-
fn cancelled(&self) -> WaitForCancellationFuture;
38+
fn cancelled(&self) -> WaitForCancellationFuture<'_>;
3939
fn filter_matchable_change(
4040
&self,
4141
candidates: &mut MatchCandidates,
@@ -85,7 +85,7 @@ impl Handle for UpdateHandle {
8585
self.inner.id
8686
}
8787

88-
fn cancelled(&self) -> WaitForCancellationFuture {
88+
fn cancelled(&self) -> WaitForCancellationFuture<'_> {
8989
self.inner.cancel.cancelled()
9090
}
9191

crates/sqlite-pool/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ where
157157
res
158158
}
159159

160-
pub fn prepare(&self, sql: &str) -> Result<InterruptibleStatement<Statement>, rusqlite::Error> {
160+
pub fn prepare(
161+
&self,
162+
sql: &str,
163+
) -> Result<InterruptibleStatement<Statement<'_>>, rusqlite::Error> {
161164
let stmt = self.conn.prepare(sql)?;
162165
self.current_sql.store(Arc::new(Some(sql.to_string())));
163166
Ok(InterruptibleStatement::new(
@@ -171,7 +174,7 @@ where
171174
pub fn prepare_cached(
172175
&self,
173176
sql: &str,
174-
) -> Result<InterruptibleStatement<CachedStatement>, rusqlite::Error> {
177+
) -> Result<InterruptibleStatement<CachedStatement<'_>>, rusqlite::Error> {
175178
let stmt = self.conn.prepare_cached(sql)?;
176179
self.current_sql.store(Arc::new(Some(sql.to_string())));
177180
Ok(InterruptibleStatement::new(

0 commit comments

Comments
 (0)