Skip to content

Commit 15fd0c7

Browse files
committed
Fix lints for 1.87
1 parent 6108610 commit 15fd0c7

63 files changed

Lines changed: 230 additions & 117 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,3 +322,10 @@ features = [
322322
"broadcast",
323323
"ondemand",
324324
]
325+
326+
[workspace.lints.rust]
327+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] }
328+
329+
[workspace.lints.clippy]
330+
# FIXME: we should work on this lint incrementally
331+
result_large_err = "allow"

crates/auth/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ jsonwebtoken.workspace = true
1616

1717
[dev-dependencies]
1818
serde_json.workspace = true
19+
20+
[lints]
21+
workspace = true

crates/bench/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,6 @@ tikv-jemalloc-ctl = { workspace = true }
8989
iai-callgrind = { git = "https://github.com/clockworklabs/iai-callgrind.git", branch = "main" }
9090
iai-callgrind-runner = { git = "https://github.com/clockworklabs/iai-callgrind.git", branch = "main" }
9191
iai-callgrind-macros = { git = "https://github.com/clockworklabs/iai-callgrind.git", branch = "main" }
92+
93+
[lints]
94+
workspace = true

crates/bindings-macro/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ proc-macro2.workspace = true
1919
quote.workspace = true
2020
syn.workspace = true
2121
heck.workspace = true
22+
23+
[lints]
24+
workspace = true

crates/bindings-sys/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ unstable = []
1515

1616
[dependencies]
1717
spacetimedb-primitives.workspace = true
18+
19+
[lints]
20+
workspace = true

crates/bindings-sys/src/lib.rs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub mod raw {
148148
///
149149
/// Traps if:
150150
/// - `prefix_elems > 0`
151-
/// and (`prefix_ptr` is NULL or `prefix` is not in bounds of WASM memory).
151+
/// and (`prefix_ptr` is NULL or `prefix` is not in bounds of WASM memory).
152152
/// - `rstart` is NULL or `rstart` is not in bounds of WASM memory.
153153
/// - `rend` is NULL or `rend` is not in bounds of WASM memory.
154154
/// - `out` is NULL or `out[..size_of::<RowIter>()]` is not in bounds of WASM memory.
@@ -161,11 +161,11 @@ pub mod raw {
161161
/// - `NO_SUCH_INDEX`, when `index_id` is not a known ID of an index.
162162
/// - `WRONG_INDEX_ALGO` if the index is not a range-compatible index.
163163
/// - `BSATN_DECODE_ERROR`, when `prefix` cannot be decoded to
164-
/// a `prefix_elems` number of `AlgebraicValue`
165-
/// typed at the initial `prefix_elems` `AlgebraicType`s of the index's key type.
166-
/// Or when `rstart` or `rend` cannot be decoded to an `Bound<AlgebraicValue>`
167-
/// where the inner `AlgebraicValue`s are
168-
/// typed at the `prefix_elems + 1` `AlgebraicType` of the index's key type.
164+
/// a `prefix_elems` number of `AlgebraicValue`
165+
/// typed at the initial `prefix_elems` `AlgebraicType`s of the index's key type.
166+
/// Or when `rstart` or `rend` cannot be decoded to an `Bound<AlgebraicValue>`
167+
/// where the inner `AlgebraicValue`s are
168+
/// typed at the `prefix_elems + 1` `AlgebraicType` of the index's key type.
169169
pub fn datastore_index_scan_range_bsatn(
170170
index_id: IndexId,
171171
prefix_ptr: *const u8,
@@ -212,7 +212,7 @@ pub mod raw {
212212
///
213213
/// Traps if:
214214
/// - `prefix_elems > 0`
215-
/// and (`prefix_ptr` is NULL or `prefix` is not in bounds of WASM memory).
215+
/// and (`prefix_ptr` is NULL or `prefix` is not in bounds of WASM memory).
216216
/// - `rstart` is NULL or `rstart` is not in bounds of WASM memory.
217217
/// - `rend` is NULL or `rend` is not in bounds of WASM memory.
218218
/// - `out` is NULL or `out[..size_of::<u32>()]` is not in bounds of WASM memory.
@@ -225,11 +225,11 @@ pub mod raw {
225225
/// - `NO_SUCH_INDEX`, when `index_id` is not a known ID of an index.
226226
/// - `WRONG_INDEX_ALGO` if the index is not a range-compatible index.
227227
/// - `BSATN_DECODE_ERROR`, when `prefix` cannot be decoded to
228-
/// a `prefix_elems` number of `AlgebraicValue`
229-
/// typed at the initial `prefix_elems` `AlgebraicType`s of the index's key type.
230-
/// Or when `rstart` or `rend` cannot be decoded to an `Bound<AlgebraicValue>`
231-
/// where the inner `AlgebraicValue`s are
232-
/// typed at the `prefix_elems + 1` `AlgebraicType` of the index's key type.
228+
/// a `prefix_elems` number of `AlgebraicValue`
229+
/// typed at the initial `prefix_elems` `AlgebraicType`s of the index's key type.
230+
/// Or when `rstart` or `rend` cannot be decoded to an `Bound<AlgebraicValue>`
231+
/// where the inner `AlgebraicValue`s are
232+
/// typed at the `prefix_elems + 1` `AlgebraicType` of the index's key type.
233233
pub fn datastore_delete_by_index_scan_range_bsatn(
234234
index_id: IndexId,
235235
prefix_ptr: *const u8,
@@ -364,7 +364,7 @@ pub mod raw {
364364
/// - `NOT_IN_TRANSACTION`, when called outside of a transaction.
365365
/// - `NO_SUCH_TABLE`, when `table_id` is not a known ID of a table.
366366
/// - `BSATN_DECODE_ERROR`, when `row` cannot be decoded to a `ProductValue`.
367-
/// typed at the `ProductType` the table's schema specifies.
367+
/// typed at the `ProductType` the table's schema specifies.
368368
/// - `UNIQUE_ALREADY_EXISTS`, when inserting `row` would violate a unique constraint.
369369
/// - `SCHEDULE_AT_DELAY_TOO_LONG`, when the delay specified in the row was too long.
370370
pub fn datastore_insert_bsatn(table_id: TableId, row_ptr: *mut u8, row_len_ptr: *mut usize) -> u16;
@@ -406,8 +406,8 @@ pub mod raw {
406406
/// - `INDEX_NOT_UNIQUE`, when the index was not unique.
407407
/// - `NO_SUCH_ROW`, when the row was not found in the unique index.
408408
/// - `BSATN_DECODE_ERROR`, when `row` cannot be decoded to a `ProductValue`
409-
/// typed at the `ProductType` the table's schema specifies
410-
/// or when it cannot be projected to the index identified by `index_id`.
409+
/// typed at the `ProductType` the table's schema specifies
410+
/// or when it cannot be projected to the index identified by `index_id`.
411411
/// - `UNIQUE_ALREADY_EXISTS`, when inserting `row` would violate a unique constraint.
412412
/// - `SCHEDULE_AT_DELAY_TOO_LONG`, when the delay specified in the row was too long.
413413
pub fn datastore_update_bsatn(
@@ -942,11 +942,11 @@ pub fn datastore_table_scan_bsatn(table_id: TableId) -> Result<RowIter, Errno> {
942942
/// - `NO_SUCH_INDEX`, when `index_id` is not a known ID of an index.
943943
/// - `WRONG_INDEX_ALGO` if the index is not a range-compatible index.
944944
/// - `BSATN_DECODE_ERROR`, when `prefix` cannot be decoded to
945-
/// a `prefix_elems` number of `AlgebraicValue`
946-
/// typed at the initial `prefix_elems` `AlgebraicType`s of the index's key type.
947-
/// Or when `rstart` or `rend` cannot be decoded to an `Bound<AlgebraicValue>`
948-
/// where the inner `AlgebraicValue`s are
949-
/// typed at the `prefix_elems + 1` `AlgebraicType` of the index's key type.
945+
/// a `prefix_elems` number of `AlgebraicValue`
946+
/// typed at the initial `prefix_elems` `AlgebraicType`s of the index's key type.
947+
/// Or when `rstart` or `rend` cannot be decoded to an `Bound<AlgebraicValue>`
948+
/// where the inner `AlgebraicValue`s are
949+
/// typed at the `prefix_elems + 1` `AlgebraicType` of the index's key type.
950950
pub fn datastore_index_scan_range_bsatn(
951951
index_id: IndexId,
952952
prefix: &[u8],
@@ -990,11 +990,11 @@ pub fn datastore_index_scan_range_bsatn(
990990
/// - `NO_SUCH_INDEX`, when `index_id` is not a known ID of an index.
991991
/// - `WRONG_INDEX_ALGO` if the index is not a range-compatible index.
992992
/// - `BSATN_DECODE_ERROR`, when `prefix` cannot be decoded to
993-
/// a `prefix_elems` number of `AlgebraicValue`
994-
/// typed at the initial `prefix_elems` `AlgebraicType`s of the index's key type.
995-
/// Or when `rstart` or `rend` cannot be decoded to an `Bound<AlgebraicValue>`
996-
/// where the inner `AlgebraicValue`s are
997-
/// typed at the `prefix_elems + 1` `AlgebraicType` of the index's key type.
993+
/// a `prefix_elems` number of `AlgebraicValue`
994+
/// typed at the initial `prefix_elems` `AlgebraicType`s of the index's key type.
995+
/// Or when `rstart` or `rend` cannot be decoded to an `Bound<AlgebraicValue>`
996+
/// where the inner `AlgebraicValue`s are
997+
/// typed at the `prefix_elems + 1` `AlgebraicType` of the index's key type.
998998
pub fn datastore_delete_by_index_scan_range_bsatn(
999999
index_id: IndexId,
10001000
prefix: &[u8],

crates/bindings/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ getrandom02 = { workspace = true, optional = true, features = ["custom"] }
3939
[dev-dependencies]
4040
insta.workspace = true
4141
trybuild.workspace = true
42+
43+
[lints]
44+
workspace = true

crates/cli/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,6 @@ tikv-jemalloc-ctl = { workspace = true }
8181

8282
[target.'cfg(windows)'.dependencies]
8383
windows-sys = { workspace = true, features = ["Win32_System_Console"] }
84+
85+
[lints]
86+
workspace = true

crates/cli/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ Fetch the server's fingerprint with:
395395

396396
let cfg = self.find_server_mut(server)?;
397397
let old_nickname = if let Some(new_nickname) = new_nickname {
398-
std::mem::replace(&mut cfg.nickname, Some(new_nickname.to_string()))
398+
cfg.nickname.replace(new_nickname.to_string())
399399
} else {
400400
None
401401
};

crates/cli/src/subcommands/logs.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,7 @@ pub async fn exec(mut config: Config, args: &ArgMatches) -> Result<(), anyhow::E
156156
let out = termcolor::StandardStream::stdout(term_color);
157157
let mut out = out.lock();
158158

159-
let mut rdr = res
160-
.bytes_stream()
161-
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))
162-
.into_async_read();
159+
let mut rdr = res.bytes_stream().map_err(io::Error::other).into_async_read();
163160
let mut line = String::new();
164161
while rdr.read_line(&mut line).await? != 0 {
165162
let record = serde_json::from_str::<Record<'_>>(&line)?;

0 commit comments

Comments
 (0)