Skip to content

Made it so quill::Plugin does not have to be in scope for plugins.#439

Merged
caelunshun merged 2 commits into
feather-rs:mainfrom
Miro-Andrin:better_plugins
Jun 27, 2021
Merged

Made it so quill::Plugin does not have to be in scope for plugins.#439
caelunshun merged 2 commits into
feather-rs:mainfrom
Miro-Andrin:better_plugins

Conversation

@Miro-Andrin

Copy link
Copy Markdown
Contributor

Small fix for plugins.

Status

  • Ready
  • Development
  • Hold

Description

The following code used to not compile, because quill::Plugin was not in scope. Now it does.

pub struct CommandPlugin {}

quill::plugin!(CommandPlugin);

impl quill::Plugin  for CommandPlugin {
    fn enable(game: &mut quill::Game, setup: &mut quill::Setup<Self>) -> Self {
        CommandPlugin{}
    }

    fn disable(self, game: &mut quill::Game) {
        todo!()
    }
}

I modified the quill::plugin! macro to not rely on quill::Plugin to be in scope.

Checklist

  • Ran cargo fmt, cargo clippy, cargo build --release and cargo test and fixed any generated errors!
  • Removed unnecessary commented out code
  • Used specific traces (if you trace actions please specify the cause i.e. the player)

@caelunshun caelunshun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

The CI failure is caused by Clippy changes in 1.53 unrelated to this PR, so I'll merge.

@caelunshun caelunshun merged commit fdcd7d3 into feather-rs:main Jun 27, 2021
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