Skip to content

Commit c22cc62

Browse files
committed
Fix lints surfaced by Rust 1.98.1 under -D warnings
CI compiles with RUSTFLAGS="-D warnings", so lints added since 1.85.0 fail the build: - mismatched_lifetime_syntaxes (new in 1.89): eleven signatures elide a lifetime on the input side (&self / &str) but hide it on the output type (Vec<Column>, PageHdrIter, CursorStep<S>, Cow<str>). Spell the output lifetime as '_ as the compiler suggests. No semantic change; this is the lifetime rustc already inferred. - unused_assignments: `frameno` in bottomless-cli's restore loop was only ever copied into BatchReader::new and then incremented, never read. BatchReader tracks its own next_frame_no and the function returns the separate last_received_frame_no, so the local was dead since it was introduced in 4a71b20. Remove it and pass first_frame_no directly. Verified locally on 1.98.1 with the same flags as CI: cargo check --all-targets --all-features, cargo fmt --check, and cargo check -p libsql --no-default-features for core/replication/remote.
1 parent e48d754 commit c22cc62

11 files changed

Lines changed: 12 additions & 14 deletions

File tree

‎bottomless-cli/src/replicator_extras.rs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,8 @@ impl Replicator {
382382
let frame = tokio::fs::File::open(&obj).await?;
383383
let frame_buf_reader = BufReader::new(frame);
384384

385-
let mut frameno = first_frame_no;
386385
let mut reader = bottomless::read::BatchReader::new(
387-
frameno,
386+
first_frame_no,
388387
frame_buf_reader,
389388
page_size as usize,
390389
compression_kind,
@@ -411,7 +410,6 @@ impl Replicator {
411410
);
412411
pending_pages.flush(db).await?;
413412
}
414-
frameno += 1;
415413
last_received_frame_no += 1;
416414
}
417415
db.flush().await?;

‎libsql-server/src/query_analysis.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ impl StmtKind {
233233
}
234234
}
235235

236-
fn to_ascii_lower(s: &str) -> Cow<str> {
236+
fn to_ascii_lower(s: &str) -> Cow<'_, str> {
237237
if s.chars().all(|c| char::is_ascii_lowercase(&c)) {
238238
Cow::Borrowed(s)
239239
} else {

‎libsql-sys/src/wal/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl PageHeaders {
131131
Self { inner }
132132
}
133133

134-
pub fn iter(&self) -> PageHdrIter {
134+
pub fn iter(&self) -> PageHdrIter<'_> {
135135
// TODO: move LIBSQL_PAGE_SIZE
136136
PageHdrIter::new(self.as_ptr(), 4096)
137137
}

‎libsql/src/hrana/cursor.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ where
147147
})
148148
}
149149

150-
pub async fn next_step(&mut self) -> Result<CursorStep<S>> {
150+
pub async fn next_step(&mut self) -> Result<CursorStep<'_, S>> {
151151
CursorStep::new(self).await
152152
}
153153

‎libsql/src/hrana/hyper.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ impl crate::statement::Stmt for crate::hrana::Statement<HttpSender> {
276276
self.cols.len()
277277
}
278278

279-
fn columns(&self) -> Vec<crate::Column> {
279+
fn columns(&self) -> Vec<crate::Column<'_>> {
280280
//FIXME: there are several blockers here:
281281
// 1. We cannot know the column types before sending a query, so this method will never return results right
282282
// away.

‎libsql/src/local/impls.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl Stmt for LibsqlStmt {
160160
self.0.column_count()
161161
}
162162

163-
fn columns(&self) -> Vec<Column> {
163+
fn columns(&self) -> Vec<Column<'_>> {
164164
self.0.columns()
165165
}
166166
}

‎libsql/src/local/statement.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ impl Statement {
339339
/// If associated DB schema can be altered concurrently, you should make
340340
/// sure that current statement has already been stepped once before
341341
/// calling this method.
342-
pub fn columns(&self) -> Vec<Column> {
342+
pub fn columns(&self) -> Vec<Column<'_>> {
343343
let n = self.column_count();
344344
let mut cols = Vec::with_capacity(n);
345345
for i in 0..n {

‎libsql/src/replication/connection.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ impl Stmt for RemoteStatement {
797797
}
798798
}
799799

800-
fn columns(&self) -> Vec<Column> {
800+
fn columns(&self) -> Vec<Column<'_>> {
801801
if let Some(stmt) = self.local_statement.as_ref() {
802802
return stmt.columns();
803803
}

‎libsql/src/statement.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub(crate) trait Stmt {
2424

2525
fn column_count(&self) -> usize;
2626

27-
fn columns(&self) -> Vec<Column>;
27+
fn columns(&self) -> Vec<Column<'_>>;
2828
}
2929

3030
/// A cached prepared statement.
@@ -103,7 +103,7 @@ impl Statement {
103103
}
104104

105105
/// Fetch the list of columns for the prepared statement.
106-
pub fn columns(&self) -> Vec<Column> {
106+
pub fn columns(&self) -> Vec<Column<'_>> {
107107
self.inner.columns()
108108
}
109109
}

‎libsql/src/sync/statement.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl Stmt for SyncedStatement {
6767
self.inner.column_count()
6868
}
6969

70-
fn columns(&self) -> Vec<Column> {
70+
fn columns(&self) -> Vec<Column<'_>> {
7171
self.inner.columns()
7272
}
7373
}

0 commit comments

Comments
 (0)