Skip to content

Commit

Permalink
- lint formatting changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
laststylebender14 committed May 21, 2024
1 parent 8a387a9 commit 8272962
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/core/generator/from_json.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::collections::HashSet;

use serde_json::{Map, Value};
use url::Url;

Expand Down Expand Up @@ -76,7 +77,11 @@ impl ConfigGenerator {
"Any".to_string()
}

fn create_type_from_object(&mut self, json_object: &Map<String, Value>, visited_field_set: &mut HashSet<String>) -> Type {
fn create_type_from_object(
&mut self,
json_object: &Map<String, Value>,
visited_field_set: &mut HashSet<String>,
) -> Type {
let mut ty = Type::default();
for (json_property, json_val) in json_object {
if visited_field_set.contains(json_property) {
Expand Down Expand Up @@ -116,7 +121,7 @@ impl ConfigGenerator {
for current_type in type_list {
for (key, value) in current_type.fields {
if let Some(existing_value) = ty.fields.get(&key) {
if existing_value.type_of.is_empty() || existing_value.type_of == "Empty" {
if existing_value.type_of.is_empty() || existing_value.type_of == "Empty" {
ty.fields.insert(key, value);
}

Check warning on line 126 in src/core/generator/from_json.rs

View check run for this annotation

Codecov / codecov/patch

src/core/generator/from_json.rs#L124-L126

Added lines #L124 - L126 were not covered by tests
} else {
Expand Down Expand Up @@ -144,7 +149,8 @@ impl ConfigGenerator {
if !self.should_generate_type(json_item) {
return self.generate_scalar();
}
object_types.push(self.create_type_from_object(json_obj,&mut visited_field_set));
object_types
.push(self.create_type_from_object(json_obj, &mut visited_field_set));
} else {
return self.generate_types(json_item);
}
Expand Down

0 comments on commit 8272962

Please sign in to comment.