-
Notifications
You must be signed in to change notification settings - Fork 112
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
Panic when using get() on an empty map #176
Comments
This is due to the fact the fix for empty maps has been merged after the latest release. The only way to fix it is to depend on the git repo instead of the Crates.io release. |
Was this fixed by #116 then? I assumed that change would've been in the latest release because it appears to have been merged on January 2018 but it looks like the 0.7.24 release was made nearly a year later in January 2019. |
You're right, my bad, I didn't look closely enough at the date and assumed it was in 2019 because the fix wasn't present in the release. However I can confirm it isn't included in 0.7.24, which is really weird. See https://github.com/sfackler/rust-phf/blob/1287414b1302d2d717c5f4be81accf4c12ccad48/phf/src/map.rs#L79-L92 |
If you look at the history, you can see #116 was actually never merged into master and the fix was only merged a year later in March by #145, shortly after the latest release. |
Try the new |
Summary: 1. Created `dcmpipe_dict_builder` which contains the code for generating constants and lookups, as a library crate. This crate writes out code assuming that constants and lookup values are in the same crate but also that the resulting crate has a dependency on `dcmpipe_lib` for the structure definitions. 2. Re-purposed `dcmpipe_dict` to only contain the constants and lookup as a separate library crate. 3. Removed `dcmpipe_lib`s dependencies on the existing dictionary. Created a `constants` module to contain the minimal tags/transfer syntaxes/uids necessary for parsing. This also required passing in tag and transfer syntax lookup to the constructor of the parser, as those are required for determining implicit VR and transfer syntax details for parsing of the dicom stream past the file meta information section. 4. `DicomStreamParser` now takes two lookup maps in its constructor for looking up tags and transfer syntax - May later keep the transfer syntax as part of `dcmpipe_lib` rather than `dcmpipe_dict` however the current setup has the transfer syntaxes parsed from the dicom standard and generated as code with the rest. Would need to pull that out from the other generated stuff from the dicom standard. Note: Some tests currently fail due to a bug in `phf`, rust-phf/rust-phf#176 Test Plan: TBD Differential Revision: https://speck.phacility.com/D13
Summary: 1. Created `dcmpipe_dict_builder` which contains the code for generating constants and lookups, as a library crate. This crate writes out code assuming that constants and lookup values are in the same crate but also that the resulting crate has a dependency on `dcmpipe_lib` for the structure definitions. 2. Re-purposed `dcmpipe_dict` to only contain the constants and lookup as a separate library crate. 3. Removed `dcmpipe_lib`s dependencies on the existing dictionary. Created a `constants` module to contain the minimal tags/transfer syntaxes/uids necessary for parsing. This also required passing in tag and transfer syntax lookup to the constructor of the parser, as those are required for determining implicit VR and transfer syntax details for parsing of the dicom stream past the file meta information section. 4. `DicomStreamParser` now takes two lookup maps in its constructor for looking up tags and transfer syntax - May later keep the transfer syntax as part of `dcmpipe_lib` rather than `dcmpipe_dict` however the current setup has the transfer syntaxes parsed from the dicom standard and generated as code with the rest. Would need to pull that out from the other generated stuff from the dicom standard. Note: Some tests currently fail due to a bug in `phf`, rust-phf/rust-phf#176 Test Plan: TBD Differential Revision: https://speck.phacility.com/D13
This can likely be closed however I am blocked on upgrading to |
Closing as the issue itself has been fixed and released. Thanks! |
Summary: 1. Created `dcmpipe_dict_builder` which contains the code for generating constants and lookups, as a library crate. This crate writes out code assuming that constants and lookup values are in the same crate but also that the resulting crate has a dependency on `dcmpipe_lib` for the structure definitions. 2. Re-purposed `dcmpipe_dict` to only contain the constants and lookup as a separate library crate. 3. Removed `dcmpipe_lib`s dependencies on the existing dictionary. Created a `constants` module to contain the minimal tags/transfer syntaxes/uids necessary for parsing. This also required passing in tag and transfer syntax lookup to the constructor of the parser, as those are required for determining implicit VR and transfer syntax details for parsing of the dicom stream past the file meta information section. 4. `DicomStreamParser` now takes two lookup maps in its constructor for looking up tags and transfer syntax - May later keep the transfer syntax as part of `dcmpipe_lib` rather than `dcmpipe_dict` however the current setup has the transfer syntaxes parsed from the dicom standard and generated as code with the rest. Would need to pull that out from the other generated stuff from the dicom standard. Note: Some tests currently fail due to a bug in `phf`, rust-phf/rust-phf#176 Test Plan: TBD Differential Revision: https://speck.phacility.com/D13
I'm not sure if this is actually supported but I did see #111 and #116 with slight variations of this.
In one of my tests I create an empty map like so
From this bit of code
Results in this panic
The text was updated successfully, but these errors were encountered: