Skip to content

Commit 04dc539

Browse files
committed
Bump Rust to 1.88 + run cargo clippy --tests --benches --all --fix
1 parent 31323cd commit 04dc539

Some content is hidden

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

90 files changed

+315
-385
lines changed

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ jobs:
183183
runs-on: ubuntu-latest
184184
timeout-minutes: 20 # on a successful run, runs in 8 minutes
185185
container:
186-
image: rust:1.87.0
186+
image: rust:1.88.0
187187
options: --privileged
188188
# filter for a comment containing 'benchmarks please'
189189
if: ${{ github.event_name != 'issue_comment' || (github.event.issue.pull_request && contains(github.event.comment.body, 'benchmarks please')) }}

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ debug = true
9191
version = "1.2.0"
9292
edition = "2021"
9393
# update rust-toolchain.toml too!
94-
rust-version = "1.87.0"
94+
rust-version = "1.88.0"
9595

9696
[workspace.dependencies]
9797
spacetimedb = { path = "crates/bindings", version = "1.2.0" }

crates/bench/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# See the README for commands to run.
44

55
# sync with: ../../rust-toolchain.toml
6-
FROM rust:1.87.0
6+
FROM rust:1.88.0
77

88
RUN apt-get update && \
99
apt-get install -y valgrind bash && \

crates/bench/src/bin/summarize.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ mod criterion {
9999

100100
/// `"{crit_dir}/"{name}.json"`
101101
fn packed_baseline_json_path(crit_dir: &Path, name: &str) -> PathBuf {
102-
crit_dir.join(format!("{}.json", name))
102+
crit_dir.join(format!("{name}.json"))
103103
}
104104

105105
lazy_static::lazy_static! {
@@ -392,7 +392,7 @@ mod callgrind {
392392
}
393393

394394
fn packed_json_path(iai_callgrind_dir: &Path, name: &str) -> PathBuf {
395-
iai_callgrind_dir.join(format!("{}.json", name))
395+
iai_callgrind_dir.join(format!("{name}.json"))
396396
}
397397

398398
fn get_iai_callgrind_dir(target_dir: &Path) -> PathBuf {

crates/bench/src/spacetime_module.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ impl<L: ModuleLanguage> BenchDatabase for SpacetimeModule<L> {
7070
});
7171

7272
for table in module.client.module.info.module_def.tables() {
73-
log::trace!("SPACETIME_MODULE: LOADED TABLE: {:?}", table);
73+
log::trace!("SPACETIME_MODULE: LOADED TABLE: {table:?}");
7474
}
7575
for reducer in module.client.module.info.module_def.reducers() {
76-
log::trace!("SPACETIME_MODULE: LOADED REDUCER: {:?}", reducer);
76+
log::trace!("SPACETIME_MODULE: LOADED REDUCER: {reducer:?}");
7777
}
7878
Ok(SpacetimeModule {
7979
runtime,

crates/bindings-macro/src/table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ pub(crate) fn table_impl(mut args: TableArgs, item: &syn::DeriveInput) -> syn::R
800800
if std::env::var("PROC_MACRO_DEBUG").is_ok() {
801801
{
802802
#![allow(clippy::disallowed_macros)]
803-
println!("{}", emission);
803+
println!("{emission}");
804804
}
805805
}
806806

crates/bindings-macro/src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub(crate) fn one_of(options: &[crate::sym::Symbol]) -> String {
7676
}
7777
_ => {
7878
let join = options.join("`, `");
79-
format!("expected one of: `{}`", join)
79+
format!("expected one of: `{join}`")
8080
}
8181
}
8282
}

crates/bindings/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ const DEFAULT_BUFFER_CAPACITY: usize = spacetimedb_primitives::ROW_ITER_CHUNK_SI
810810
#[doc(hidden)]
811811
pub fn table_id_from_name(table_name: &str) -> TableId {
812812
sys::table_id_from_name(table_name).unwrap_or_else(|_| {
813-
panic!("Failed to get table with name: {}", table_name);
813+
panic!("Failed to get table with name: {table_name}");
814814
})
815815
}
816816

crates/cli/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ use std::process::Command;
44
fn main() {
55
let output = Command::new("git").args(["rev-parse", "HEAD"]).output().unwrap();
66
let git_hash = String::from_utf8(output.stdout).unwrap();
7-
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
7+
println!("cargo:rustc-env=GIT_HASH={git_hash}");
88
}

crates/cli/src/subcommands/call.rs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ use super::sql::parse_req;
1616

1717
pub fn cli() -> clap::Command {
1818
clap::Command::new("call")
19-
.about(format!(
20-
"Invokes a reducer function in a database. {}",
21-
UNSTABLE_WARNING
22-
))
19+
.about(format!("Invokes a reducer function in a database. {UNSTABLE_WARNING}"))
2320
.arg(
2421
Arg::new("database")
2522
.required(true)
@@ -38,7 +35,7 @@ pub fn cli() -> clap::Command {
3835
}
3936

4037
pub async fn exec(config: Config, args: &ArgMatches) -> Result<(), Error> {
41-
eprintln!("{}\n", UNSTABLE_WARNING);
38+
eprintln!("{UNSTABLE_WARNING}\n");
4239
let reducer_name = args.get_one::<String>("reducer_name").unwrap();
4340
let arguments = args.get_many::<String>("arguments");
4441

@@ -60,7 +57,7 @@ pub async fn exec(config: Config, args: &ArgMatches) -> Result<(), Error> {
6057
.zip(&*reducer_def.params.elements)
6158
.map(|(argument, element)| match &element.algebraic_type {
6259
AlgebraicType::String if !argument.starts_with('\"') || !argument.ends_with('\"') => {
63-
format!("\"{}\"", argument)
60+
format!("\"{argument}\"")
6461
}
6562
_ => argument.to_string(),
6663
});
@@ -74,7 +71,7 @@ pub async fn exec(config: Config, args: &ArgMatches) -> Result<(), Error> {
7471
bail!(e);
7572
};
7673

77-
let error = Err(e).context(format!("Response text: {}", response_text));
74+
let error = Err(e).context(format!("Response text: {response_text}"));
7875

7976
let error_msg = if response_text.starts_with("no such reducer") {
8077
no_such_reducer(&database_identity, database, reducer_name, &module_def)
@@ -106,8 +103,7 @@ fn invalid_arguments(
106103
if let Some((actual, expected)) = find_actual_expected(text).filter(|(a, e)| a != e) {
107104
write!(
108105
error,
109-
"\n\n{} parameters were expected, but {} were provided.",
110-
expected, actual
106+
"\n\n{expected} parameters were expected, but {actual} were provided."
111107
)
112108
.unwrap();
113109
}
@@ -170,10 +166,8 @@ impl std::fmt::Display for ReducerSignature<'_> {
170166

171167
/// Returns an error message for when `reducer` does not exist in `db`.
172168
fn no_such_reducer(database_identity: &Identity, db: &str, reducer: &str, module_def: &ModuleDef) -> String {
173-
let mut error = format!(
174-
"No such reducer `{}` for database `{}` resolving to identity `{}`.",
175-
reducer, db, database_identity
176-
);
169+
let mut error =
170+
format!("No such reducer `{reducer}` for database `{db}` resolving to identity `{database_identity}`.");
177171

178172
add_reducer_ctx_to_err(&mut error, module_def, reducer);
179173

@@ -192,7 +186,7 @@ fn add_reducer_ctx_to_err(error: &mut String, module_def: &ModuleDef, reducer_na
192186
.collect::<Vec<_>>();
193187

194188
if let Some(best) = find_best_match_for_name(&reducers, reducer_name, None) {
195-
write!(error, "\n\nA reducer with a similar name exists: `{}`", best).unwrap();
189+
write!(error, "\n\nA reducer with a similar name exists: `{best}`").unwrap();
196190
} else if reducers.is_empty() {
197191
write!(error, "\n\nThe database has no reducers.").unwrap();
198192
} else {
@@ -207,13 +201,13 @@ fn add_reducer_ctx_to_err(error: &mut String, module_def: &ModuleDef, reducer_na
207201
// List them.
208202
write!(error, "\n\nHere are some existing reducers:").unwrap();
209203
for candidate in reducers {
210-
write!(error, "\n- {}", candidate).unwrap();
204+
write!(error, "\n- {candidate}").unwrap();
211205
}
212206

213207
// When some where not listed, note that are more.
214208
if too_many_to_show {
215209
let plural = if diff == 1 { "" } else { "s" };
216-
write!(error, "\n... ({} reducer{} not shown)", diff, plural).unwrap();
210+
write!(error, "\n... ({diff} reducer{plural} not shown)").unwrap();
217211
}
218212
}
219213
}

0 commit comments

Comments
 (0)