Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Modules] spacetimedb(index) macro now uses more consistent parens. #97

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

gefjon
Copy link
Contributor

@gefjon gefjon commented Jul 24, 2023

Description of Changes

Prior to this comment, the #[spacetimedb(index)] attribute accepted its arguments like:

#[spacetimedb(index(btree), name = "NAME", FIELD_NAMES...)]

This was weird and bad. Putting the NAME and FIELD_NAMES arguments outside of the inner parens was uninutitive. With this commit, the syntax is changed to:

#[spacetimedb(index(btree, name = "NAME", FIELD_NAMES...))]

API

  • This is a breaking change to the module API
  • This is a breaking change to the ClientAPI
  • This is a breaking change to the SDK API

If the API is breaking, please state below what will break

The syntax of #[spacetimedb(index)] has changed. Module authors will need to grep for index declarations and alter the parens around the arguments.

Prior to this comment, the `#[spacetimedb(index)]` attribute accepted its arguments like:

```rust
```

This was weird and bad. Putting the `NAME` and `FIELD_NAMES` arguments outside of the
inner parens was uninutitive. With this commit, the syntax is changed to:

```rust
```
Copy link
Contributor

@cloutiertyler cloutiertyler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me!

@gefjon gefjon merged commit fc245ce into master Jul 24, 2023
4 checks passed
cloutiertyler pushed a commit that referenced this pull request Aug 1, 2023
…#97)

Prior to this comment, the `#[spacetimedb(index)]` attribute accepted its arguments like:

```rust
\#[spacetimedb(index(btree), name = "NAME", FIELD_NAMES...)]
```

Putting the `NAME` and `FIELD_NAMES` arguments outside of the
inner parens was uninutitive. With this commit, the syntax is changed to:

```rust

\#[spacetimedb(index(btree, name = "NAME", FIELD_NAMES...))]
```
cloutiertyler pushed a commit that referenced this pull request Aug 1, 2023
…#97)

Prior to this comment, the `#[spacetimedb(index)]` attribute accepted its arguments like:

```rust
\#[spacetimedb(index(btree), name = "NAME", FIELD_NAMES...)]
```

Putting the `NAME` and `FIELD_NAMES` arguments outside of the
inner parens was uninutitive. With this commit, the syntax is changed to:

```rust

\#[spacetimedb(index(btree, name = "NAME", FIELD_NAMES...))]
```
@cloutiertyler cloutiertyler deleted the phoebe/index-macro-paren-syntax branch August 1, 2023 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants