feat: implement API for providing custom index#241
Open
vytautas-astrauskas-sensmetry wants to merge 1 commit intomainfrom
Open
feat: implement API for providing custom index#241vytautas-astrauskas-sensmetry wants to merge 1 commit intomainfrom
vytautas-astrauskas-sensmetry wants to merge 1 commit intomainfrom
Conversation
d9ea593 to
0e252d6
Compare
Signed-off-by: Vytautas Astrauskas <vytautas.astrauskas@sensmetry.com>
0e252d6 to
629c3d4
Compare
Comment on lines
+236
to
+246
| pub fn update_index( | ||
| &mut self, | ||
| new_index: IndexMap<String, String>, | ||
| ) -> Result<(), LocalSrcError> { | ||
| let mut meta = self | ||
| .get_meta()? | ||
| .unwrap_or_else(InterchangeProjectMetadataRaw::default); | ||
| meta.index = new_index; | ||
| self.put_meta(&meta, true)?; | ||
| Ok(()) | ||
| } |
Collaborator
There was a problem hiding this comment.
Since this only uses .get_meta() and .put_meta() (and nothing specific to LocalSrcProject) it should go with the other utility functions in the ProjectMut trait.
Comment on lines
+315
to
+320
| match project.update_index(rust_index) { | ||
| Ok(()) => {} | ||
| Err(e) => { | ||
| env.throw_exception(ExceptionKind::SysandException, e.to_string()); | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
Suggested change
| match project.update_index(rust_index) { | |
| Ok(()) => {} | |
| Err(e) => { | |
| env.throw_exception(ExceptionKind::SysandException, e.to_string()); | |
| } | |
| } | |
| let _ = project | |
| .update_index(rust_index) | |
| .inspect_err(|e| env.throw_exception(ExceptionKind::SysandException, e.to_string())); |
Maybe a bit simpler if no early return is needed.
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.
No description provided.