Skip to content

Add internal modules into lib.rs and fix visibility #6

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

Merged
merged 4 commits into from
Sep 8, 2020
Merged

Add internal modules into lib.rs and fix visibility #6

merged 4 commits into from
Sep 8, 2020

Conversation

kenkoooo
Copy link
Contributor

@kenkoooo kenkoooo commented Sep 8, 2020

Add internal_*** modules into lib.rs and fix the visibility of modules like the following:

  • Change public modules from mod to pub mod so that the users can import them.
  • Make internal modules pub(crate) mod to allow other modules can use them internally.

@koba-e964
Copy link
Collaborator

koba-e964 commented Sep 8, 2020

I prefer exposing functions/structs directly in like ac_library_rs::FenwickTree by re-exporting in lib.rs

pub use fenwicktree::FenwickTree;

to ac_library_rs::fenwick_tree::FenwickTree.
That's because ACL adopts the same policy. (using namespace atcoder; imports everything.)

I'd like to hear what other contributors think.

@qryxip
Copy link
Member

qryxip commented Sep 8, 2020

As a compromise, we have an another option to add src/prelude.rs.

That adapts to the policy of original ACL, I think. (as it is intended to be used with using namespace atcoder;)

pub use crate::fenwicktree::FenwickTree; 

@qryxip
Copy link
Member

qryxip commented Sep 8, 2020

We also have to take into consideration that this crate will be unlikely introduced to the system of AtCoder.

https://twitter.com/chokudai/status/1303025509488496645

The users have to expand the code with some tool. (e.g. hatoo/cargo-snippet, shino16/cargo-auto-bundle, qryxip/cargo-equip)

@qryxip qryxip mentioned this pull request Sep 8, 2020
@kenkoooo
Copy link
Contributor Author

kenkoooo commented Sep 8, 2020

Thanks. That makes sense to me. Let me make pub mods private.

@qryxip
Copy link
Member

qryxip commented Sep 8, 2020

let us merge.

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.

3 participants