Skip to content

Commit c461c11

Browse files
committed
fix rust table macro
1 parent 158f057 commit c461c11

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

crates/bindings-macro/src/table.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ struct ScheduledArg {
4747
}
4848

4949
struct IndexArg {
50-
is_inline: bool,
5150
accessor: Ident,
5251
//TODO: add canonical name
5352
// name: Option<LitStr>,
@@ -64,13 +63,11 @@ impl IndexArg {
6463
accessor,
6564
is_unique,
6665
kind,
67-
is_inline: true,
6866
// name,
6967
}
7068
}
7169
fn explicit(accessor: Ident, kind: IndexType) -> Self {
7270
Self {
73-
is_inline: false,
7471
accessor,
7572
is_unique: false,
7673
kind,
@@ -351,7 +348,6 @@ impl IndexArg {
351348
// as it is used in `index_id_from_name` abi.
352349
index_name: gen_index_name(),
353350
accessor_name: &self.accessor,
354-
using_field_as_accessor: self.is_inline,
355351
kind,
356352
})
357353
}
@@ -409,7 +405,6 @@ impl AccessorType {
409405
struct ValidatedIndex<'a> {
410406
index_name: String,
411407
accessor_name: &'a Ident,
412-
using_field_as_accessor: bool,
413408
is_unique: bool,
414409
kind: ValidatedIndexType<'a>,
415410
}
@@ -458,16 +453,12 @@ impl ValidatedIndex<'_> {
458453
})
459454
}
460455
};
461-
let accessor_name = if self.using_field_as_accessor {
462-
self.index_name.clone()
463-
} else {
464-
ident_to_litstr(self.accessor_name).value()
465-
};
456+
let source_name = self.index_name.clone();
466457
// Note: we do not pass the index_name through here.
467458
// We trust the schema validation logic to reconstruct the name we've stored in `self.name`.
468459
//TODO(shub): pass generated index name instead of accessor name as source_name
469460
quote!(spacetimedb::table::IndexDesc {
470-
source_name: #accessor_name,
461+
source_name: #source_name,
471462
algo: #algo,
472463
})
473464
}
@@ -859,7 +850,6 @@ pub(crate) fn table_impl(mut args: TableArgs, item: &syn::DeriveInput) -> syn::R
859850
let accessor = unique_col.ident.clone();
860851
let columns = vec![accessor.clone()];
861852
args.indices.push(IndexArg {
862-
is_inline: true,
863853
accessor,
864854
//name: None,
865855
is_unique: true,

0 commit comments

Comments
 (0)