Skip to content

Better import path #246

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

Closed
irevoire opened this issue Feb 24, 2022 · 0 comments · Fixed by #493
Closed

Better import path #246

irevoire opened this issue Feb 24, 2022 · 0 comments · Fixed by #493
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@irevoire
Copy link
Member

Description
It's quite boring to start every file with use meilisearch_sdk::{document::*, client::*};
It would be better if in the lib.rs we were re-exporting every structure like that:

pub use client::*;
pub use index::*;
...

Basic example

And thus let us (=the users) write import like that;

use meilisearch_sdk::*;

Or if you want a few basic structure structures:

use meilisearch_sdk::{Client, Index, Setting};
// instead of
use meilisearch_sdk::{client::Client, indexes::Index, settings::Setting};

Other

Also, I never remember which module name is plural or singular so it would hide our inconsistencies in a non-breaking change.

Another solution would be to provide a prelude like in most libraries but I'm not sure we really need it currently since our lib is so smol 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants