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

Add support for indexmap #527

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hardliner66
Copy link

I added the possibility to enable the use of an IndexMap inside of the templates. I currently use liquid in a tool of mine, where I use an IndexMap to keep elements in the order they were inserted in, as re-ordering those could lead to bugs further down.

@@ -38,3 +39,4 @@ snapbox = "0.4.14"
[features]
default = []
derive = ["liquid-derive"]
indexmap = ["dep:indexmap"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should suffix the feature with a 2 to track that this feature is for v2 (and allow us to support a v3, etc)?

Comment on lines +364 to +365
#[cfg(feature = "indexmap")]
impl<K: ObjectIndex, V: ValueView> ValueView for IndexMap<K, V> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you put this right after BTreeMaps impl?

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.

None yet

2 participants