Draft
Conversation
In Rust, by convention, traits with a single method are named the same as the method. `Liftable` should be called `Lift`, make it so.
83336be to
2314693
Compare
Observe: - The semantic/abstract policy is a rust-miniscript thing but the policy language (`concrete::Policy`) is a general miniscript thing. - The `semantic::Policy` can be created by lifting more than just a concrete policy (eg, a descriptor). Do the following: - Move `src/policy/semantic.rs` to `src/lift/lifted.rs` (leaving the type as `Policy`). - Move the contents of `src/policy/mod.rs` (excl. tests/benches) to `src/lift/mod.rs`. - Add a re-export `lift::lifted::Policy as Lifted` and use it in other parts of the code base. Note, the idea to keep the `lifted::Policy` as is and re-export helps keep this patch smaller but also gives some choice to how the type is used - `use crate::lift::Liftded` coupled with usage of `Lifted`. - `use crate::lift::lifted` coupled with usage of `lifted::Policy` We can the do a rename later if deemed appropriate.
2314693 to
ddc961e
Compare
Member
|
I like this. @sanket1729 what do you think? |
Member
Author
|
Do we want to do this? |
Member
|
The TL;DR of this PR is:
In short, yes, I want to do this, but we should think about whether we can make the transition easier somehow. (The type renames we can definitely do with deprecations and/or type aliases and backports; the trait I'm less sure about.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an alternative to #604 based on review suggestion.
Draft for feedback please.