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

Flatten serenity::model #2394

Closed
kangalio opened this issue Apr 21, 2023 · 5 comments
Closed

Flatten serenity::model #2394

kangalio opened this issue Apr 21, 2023 · 5 comments
Labels
enhancement An improvement to Serenity. feature-request A new requested functionality. model Related to the `model` module.

Comments

@kangalio
Copy link
Collaborator

kangalio commented Apr 21, 2023

It would be better if all model types were accessible via just serenity::model::ModelType. I don't think anyone can remember which serenity::model submodule a model type belongs to.

This would also make the job of serenity::model::prelude redundant.

A few types should be renamed to be less ambiguous, like Rule and Options.

There should ideally be redirects from the old paths to the new paths.

This needs to wait until at least after #2393

@mkrasnitski
Copy link
Collaborator

I'd nominate this to go into 0.13 - since literally every user interacts with the model in some way, this is a breaking change that would be widely felt, and we're already loaded pretty heavy on those for 0.12.

@kangalio
Copy link
Collaborator Author

Good point, I agree

@kangalio
Copy link
Collaborator Author

We could also just add pub use submodule::*; for every model submodule. That way, the old paths stay accessible perfectly accessible, but serenity::model::ModelType also works. That's how I do it in poise: https://docs.rs/poise/latest/poise/#reexports.

What do you think about that?

I think this feature would be very nice for new code written using serenity, to avoid noisy long paths and duplicate-ish imports.

@ivinjabraham
Copy link
Contributor

Is this intended to be open after this message by @mkrasnitski?

@GnomedDev
Copy link
Member

Doesn't look like it.

@GnomedDev GnomedDev closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement to Serenity. feature-request A new requested functionality. model Related to the `model` module.
Projects
None yet
5 participants