Skip to content

Commit 4f174a7

Browse files
Upgrade SpacetimeDB to v1.6.0 (#72)
* Change SpacetimeDB to v1.6.0 * auto fix on clippy run * run format + clippy
1 parent 449c35f commit 4f174a7

File tree

12 files changed

+64
-107
lines changed

12 files changed

+64
-107
lines changed

Cargo.lock

Lines changed: 20 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
authors = ["Tamaro Skaljic<mail@tamaro-skaljic.de>"]
33
name = "spacetimedsl"
4-
version = "0.10.0"
4+
version = "0.11.0"
55
edition = "2024"
66
description = "Ergonomic DSL for SpacetimeDB"
77
documentation = "https://docs.rs/spacetimedsl"
@@ -14,10 +14,10 @@ readme = "README.md"
1414

1515
[dependencies]
1616
# https://crates.io/crates/spacetimedb Easy support for interacting between SpacetimeDB and Rust.
17-
spacetimedb = "1.2.0"
17+
spacetimedb = "1.6.0"
1818

1919
# https://crates.io/crates/spacetimedsl_derive Macros to extend SpacetimeDSL
20-
spacetimedsl_derive = { version = "0.10.0", path = "derive" }
20+
spacetimedsl_derive = { version = "0.11.0", path = "derive" }
2121

2222
# https://crates.io/crates/itertools Extra iterator adaptors, iterator methods, free functions, and macros.
2323
itertools = "^0.14"

debug-helper/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ syn = { default-features = false, features = [
1313
"extra-traits",
1414
"full",
1515
"parsing",
16-
], version = "2.0.103" } # https://crates.io/crates/syn
16+
], version = "2" } # https://crates.io/crates/syn

derive-input/Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
authors = ["Tamaro Skaljic<mail@tamaro-skaljic.de>"]
33
name = "spacetimedsl_derive-input"
4-
version = "0.10.0"
4+
version = "0.11.0"
55
edition = "2024"
66
description = "Contains structs which represent the input and output of SpacetimeDSL. Can be used by other proc-macro crates to build Macros which utilize SpacetimeDSL under the hood."
77
documentation = "https://docs.rs/spacetimedsl_derive-input"
@@ -16,22 +16,22 @@ keywords = ["dsl", "spacetime", "macro", "codegen", "boilerplate"]
1616
ident_case = "1.0.1"
1717

1818
# https://crates.io/crates/proc_macro2 A substitute implementation of the compiler's `proc_macro` API to decouple token-based libraries from the procedural macro use case.
19-
proc-macro2 = "1.0"
19+
proc-macro2 = "1"
2020

2121
# https://crates.io/crates/syn Parser for Rust source code
22-
syn = { version = "2.0.103" }
22+
syn = { version = "2" }
2323

2424
# https://crates.io/crates/quote Quasi-quoting macro quote!(...)
25-
quote = "1.0"
25+
quote = "1"
2626

2727
# https://crates.io/crates/itertools Extra iterator adaptors, iterator methods, free functions, and macros.
28-
itertools = "^0.14"
28+
itertools = "0.14.0"
2929

3030
# https://crates.io/crates/spacetimedb Easy support for interacting between SpacetimeDB and Rust.
31-
spacetimedb = "1.2.0"
31+
spacetimedb = "1.6.0"
3232

3333
# https://crates.io/crates/spacetime-bindings-macro-input Unofficial Input Crate for the SpacetimeDB Macro Bindings.
34-
spacetime-bindings-macro-input = "1.1.1"
34+
spacetime-bindings-macro-input = "1.6.0"
3535

3636
# https://crates.io/crates/strum Helpful macros for working with enums and strings
37-
strum = { version = "0.27", features = ["derive"] }
37+
strum = { version = "0.27.2", features = ["derive"] }

derive-input/src/internal/column.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use proc_macro2::Span;
1414
use spacetime_bindings_macro_input::table::ColumnArgs;
1515
use syn::{Ident, Path};
1616

17+
#[allow(clippy::type_complexity)]
1718
pub(in crate::internal) fn try_parse(
1819
column_args: &ColumnArgs,
1920
rust_struct: &RustStruct,

derive-input/src/internal/dsl/table.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@ impl SpacetimeDSLTable {
1717
) -> syn::Result<(SpacetimeDBTable, SpacetimeDSLTable)> {
1818
for unique_index_name in unique_indices {
1919
for multi_column_index in &mut spacetimedb_table.multi_column_indices {
20-
if let IndexType::BTreeMultiColumn { columns: _ } = &multi_column_index.index_type {
21-
if multi_column_index.name.eq(&unique_index_name) {
22-
multi_column_index.is_unique = true;
23-
}
20+
if let IndexType::BTreeMultiColumn { columns: _ } = &multi_column_index.index_type
21+
&& multi_column_index.name.eq(&unique_index_name)
22+
{
23+
multi_column_index.is_unique = true;
2424
}
2525
}
2626
}
2727

2828
match column_args
2929
.primary_key_column
30+
.as_ref()
3031
.expect("The table should have a `#[primary_key]` column!")
3132
.vis
3233
{

derive-input/src/internal/integration.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@ fn get_all_table_attributes<'a>(
1616
// Find all table attributes
1717
let mut table_attrs = Vec::new();
1818
for attr in &input.attrs {
19-
if let Ok(list) = attr.meta.require_list() {
20-
if list.path.to_token_stream().to_string().eq("table")
19+
if let Ok(list) = attr.meta.require_list()
20+
&& (list.path.to_token_stream().to_string().eq("table")
2121
|| list
2222
.path
2323
.to_token_stream()
2424
.to_string()
25-
.eq("spacetimedb :: table")
26-
{
27-
table_attrs.push(list.tokens.clone());
28-
}
25+
.eq("spacetimedb :: table"))
26+
{
27+
table_attrs.push(list.tokens.clone());
2928
}
3029
}
3130

derive/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
authors = ["Tamaro Skaljic<mail@tamaro-skaljic.de>"]
33
name = "spacetimedsl_derive"
4-
version = "0.10.0"
4+
version = "0.11.0"
55
edition = "2024"
66
description = "Macros to extend SpacetimeDSL. You shouldn't depend on this directly and instead use the spacetimedsl crate."
77
documentation = "https://docs.rs/spacetimedsl_derive"
@@ -19,16 +19,16 @@ proc-macro = true
1919
ident_case = "1.0.1"
2020

2121
# https://crates.io/crates/proc_macro2 A substitute implementation of the compiler's `proc_macro` API to decouple token-based libraries from the procedural macro use case.
22-
proc-macro2 = "1.0"
22+
proc-macro2 = "1"
2323

2424
# https://crates.io/crates/syn Parser for Rust source code
25-
syn = { version = "2.0.103" }
25+
syn = { version = "2" }
2626

2727
# https://crates.io/crates/quote Quasi-quoting macro quote!(...)
28-
quote = "1.0"
28+
quote = "1"
2929

3030
# https://crates.io/crates/rust-format A Rust source code formatting crate with a unified interface for string, file, and TokenStream input
3131
rust-format = { version = "0.3.4", features = [ "pretty_please", "token_stream" ]}
3232

3333
# https://crates.io/crates/spacetimedsl_derive-input Contains structs which represent the output of SpacetimeDSL. Can be used by other proc-macro crates to build Macros which utilize SpacetimeDSL under the hood.
34-
spacetimedsl_derive-input = { version = "0.10.0", path = "../derive-input" }
34+
spacetimedsl_derive-input = { version = "0.11.0", path = "../derive-input" }

derive/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ fn is_last_dsl_attribute(derive_input: &syn::DeriveInput) -> bool {
9898

9999
/// Make all struct fields private by setting their visibility to Inherited
100100
fn make_struct_fields_private(derive_input: &mut syn::DeriveInput) {
101-
if let syn::Data::Struct(data_struct) = &mut derive_input.data {
102-
if let syn::Fields::Named(fields) = &mut data_struct.fields {
103-
for field in &mut fields.named {
104-
field.vis = syn::Visibility::Inherited;
105-
}
101+
if let syn::Data::Struct(data_struct) = &mut derive_input.data
102+
&& let syn::Fields::Named(fields) = &mut data_struct.fields
103+
{
104+
for field in &mut fields.named {
105+
field.vis = syn::Visibility::Inherited;
106106
}
107107
}
108108
}

0 commit comments

Comments
 (0)