feat: implement API for providing custom index#241
feat: implement API for providing custom index#241vytautas-astrauskas-sensmetry merged 1 commit intomainfrom
Conversation
0e252d6 to
629c3d4
Compare
core/src/project/local_src.rs
Outdated
| 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(()) | ||
| } |
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.
There was a problem hiding this comment.
Cannot do this anymore because 9314c8e added dependency on LocalSrcError.
There was a problem hiding this comment.
Why? ProjectMut returns project-specific errors, so every project type can return their own variant of this error.
IMO not worth doing it now, as there is no current usecase for other project types.
There was a problem hiding this comment.
ProjectMut::Error is a type variable:
sysand/core/src/project/mod.rs
Lines 338 to 339 in 3661cd3
set_index method to ProjectMut, then it has to be abstract in the trait and have a concrete implementation for each project type. Alternatively, we could have an abstract method create_metadata_error that has a concrete implementation for each project type. In both cases, the effort does not feel worth it the gains at the moment.
bindings/java/java/src/main/java/com/sensmetry/sysand/Sysand.java
Outdated
Show resolved
Hide resolved
e73d07b to
89fe21d
Compare
18b6cde to
2a26f24
Compare
andrius-puksta-sensmetry
left a comment
There was a problem hiding this comment.
Looks good.
f902bc5 to
9cb2fe0
Compare
Signed-off-by: Vytautas Astrauskas <vytautas.astrauskas@sensmetry.com> Co-authored-by: Victor Linroth <victor.linroth@sensmetry.com> Co-authored-by: Andrius Pukšta <andrius.puksta@sensmetry.com> Signed-off-by: Vytautas Astrauskas <vytautas.astrauskas@sensmetry.com>
9cb2fe0 to
0e1f870
Compare
No description provided.