-
Notifications
You must be signed in to change notification settings - Fork 60
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
Replace external dependencies with re-exports #1154
base: next
Are you sure you want to change the base?
Conversation
@varun-doshi What is the state of this PR 🙂? Would you like to continue working on this? |
Apologies for the delay @PhilippGackstatter . I will get this done in the next few hours. Will raise another Pr for the other 3 crates |
On second thought, if you'd like I can split this PR into 2 separate ones as well considering this PR has 40 file changes to clarify: Let me know how you'd like me to proceed @PhilippGackstatter |
…nto varun/rm-ext-deps
b0a5a9d
to
53980df
Compare
use super::{AccountId, Asset, Word}; | ||
use crate::note::{ | ||
scripts, NoteError, NoteExecutionMode, NoteInputs, NoteRecipient, NoteTag, NoteType, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not import these from super
. If we now remove the Word
import from crates/miden-lib/src/note/mod.rs
then this file would also be affected, and those should ideally be independent.
I would prefer using crate::
imports.
I think I would generally avoid super
imports, as they are more likely to break during a refactor.
Could you rewrite super
imports to crate
or the corresponding crate, if it's not exported from the crate? For example here, AccountId
should be imported from miden_objects
because that's where it is originally defined and we don't re-export it from the miden-lib
root, which is good.
If you're using VS Code you can set "rust-analyzer.imports.prefix": "crate"
so it will prefer importing from crate::
.
Since it's all in this PR now, it's fine to keep it as one. I think this PR does more than described in #1145. The goal is to only rewrite imports that are re-exported from the crate itself. For example in miden-objects, we re-export miden-base/crates/miden-objects/src/lib.rs Lines 35 to 40 in 6d82ff2
And in this file, for example, we import
That is unnecessary. Here we can replace the So the issue only applies to re-exports. Does that make sense? Btw. your first commit is not signed. Can you sign it? Or alternatively, opening a new PR is also fine :) Thank you! |
@PhilippGackstatter I've opened a new PR for |
Ref #1145
Currently replaced external dependencies in the following packages:
Will update this as I push changes