Skip to content

Commit

Permalink
- clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
laststylebender14 committed Sep 5, 2024
1 parent 763cb5d commit 567bba5
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/cli/llm/infer_type_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,13 @@ impl AsyncTransform for InferTypeName {

async fn transform(&self, value: Self::Value) -> Valid<Self::Value, Self::Error> {
match self.generate(&value).await {
Ok(suggested_names) => {
match RenameTypes::new(suggested_names.iter())
.transform(value)
.to_result()
{
Ok(v) => Valid::succeed(v),
Err(e) => Valid::fail(Error::Err(e.to_string())),
}
}
Err(err) => Valid::fail(err),
Ok(suggested_names) => RenameTypes::new(suggested_names.iter())
.transform(value)
.to_result()
.map(Valid::succeed)
.map_err(|e| Error::Err(e.to_string()))
.unwrap_or_else(Valid::fail),
Err(e) => Valid::fail(e),

Check warning on line 163 in src/cli/llm/infer_type_name.rs

View check run for this annotation

Codecov / codecov/patch

src/cli/llm/infer_type_name.rs#L155-L163

Added lines #L155 - L163 were not covered by tests
}
}

Check warning on line 165 in src/cli/llm/infer_type_name.rs

View check run for this annotation

Codecov / codecov/patch

src/cli/llm/infer_type_name.rs#L165

Added line #L165 was not covered by tests
}
Expand Down

0 comments on commit 567bba5

Please sign in to comment.