You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the tags of a bibliography entry are stored in a HashMap, which means the order of the tags is unstable.
I have a use-case in mind where I would like to parse a bibliography entry from a file, perform some minor edits, and then write the new entry back to the same file. If I use nom-bibtex for the parsing then I have no way to recover the original order of the tags in the entry. This could potentially make the version control history of the file confusing to decipher.
If you're also interested in remembering the order of the tags, I suppose one option would be to replace HashMap with IndexMap from the indexmap crate. Another option would be storing a Vec<String> of the keys alongside the HashMap.
The text was updated successfully, but these errors were encountered:
Yeah it is annoying that IndexMap isn't in std, although it does seem like the most performant way to handle this. Maybe storing the keys of the tags in a Vec<String> is a better approach though. What do you think?
Currently the tags of a bibliography entry are stored in a
HashMap
, which means the order of the tags is unstable.I have a use-case in mind where I would like to parse a bibliography entry from a file, perform some minor edits, and then write the new entry back to the same file. If I use
nom-bibtex
for the parsing then I have no way to recover the original order of the tags in the entry. This could potentially make the version control history of the file confusing to decipher.If you're also interested in remembering the order of the tags, I suppose one option would be to replace
HashMap
withIndexMap
from the indexmap crate. Another option would be storing aVec<String>
of the keys alongside theHashMap
.The text was updated successfully, but these errors were encountered: