Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-1991 committed Jul 1, 2024
1 parent 4f746db commit b9e1158
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub fn parse_mdmodel(input: TokenStream) -> TokenStream {

// Parse the DataModel from the specified path
let model = DataModel::from_markdown(&path)
.expect(format!("Failed to parse the markdown model at path: {:?}", path).as_str());
.unwrap_or_else(|_| panic!("Failed to parse the markdown model at path: {:?}", path));
let model_name = syn::Ident::new(
&to_snake(model.name.unwrap_or("model".to_string())),
proc_macro2::Span::call_site(),
Expand Down
6 changes: 3 additions & 3 deletions tests/test_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mod tests {
test::ObjectBuilder::default()
.string_value("Hello, World!")
.integer_value(42)
.float_value(3.14)
.float_value(3.2)
.boolean_value(true)
.multiple_values(vec![1.12, 1.0])
.nested_object(
Expand Down Expand Up @@ -40,7 +40,7 @@ mod tests {
test::Object {
string_value: Some("Hello, World!".to_string()),
integer_value: Some(42),
float_value: Some(3.14),
float_value: Some(3.2),
boolean_value: Some(true),
multiple_values: Some(vec![1.12, 1.0]),
nested_object: Some(test::Nested {
Expand Down Expand Up @@ -86,7 +86,7 @@ mod tests {
let object: test::Object = serde_json::from_str(json).expect("Failed to parse JSON");
assert_eq!(object.string_value, Some("Hello, World!".to_string()));
assert_eq!(object.integer_value, Some(42));
assert_eq!(object.float_value, Some(3.14));
assert_eq!(object.float_value, Some(3.2));
assert_eq!(object.boolean_value, Some(true));
assert_eq!(object.multiple_values, Some(vec![1.12, 1.0]));
assert_eq!(
Expand Down

0 comments on commit b9e1158

Please sign in to comment.