Skip to content

Commit 3f318d8

Browse files
committed
Fix lint
1 parent 586c8dc commit 3f318d8

5 files changed

Lines changed: 25 additions & 19 deletions

File tree

crates/vespera_macro/src/parser/schema/struct_schema.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,20 @@ mod tests {
196196
let props = schema.properties.as_ref().unwrap();
197197
assert!(props.contains_key("id"));
198198
assert!(props.contains_key("name"));
199-
assert!(schema
200-
.required
201-
.as_ref()
202-
.unwrap()
203-
.contains(&"id".to_string()));
204-
assert!(!schema
205-
.required
206-
.as_ref()
207-
.unwrap()
208-
.contains(&"name".to_string()));
199+
assert!(
200+
schema
201+
.required
202+
.as_ref()
203+
.unwrap()
204+
.contains(&"id".to_string())
205+
);
206+
assert!(
207+
!schema
208+
.required
209+
.as_ref()
210+
.unwrap()
211+
.contains(&"name".to_string())
212+
);
209213
}
210214

211215
#[test]

crates/vespera_macro/src/parser/schema/type_schema.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ fn parse_type_impl(
327327
})),
328328
// Standard library types that should not be referenced
329329
// Note: HashMap and BTreeMap are handled above in generic types
330-
"Vec" | "HashSet" | "BTreeSet" | "Option" | "Result" | "Json" | "Path" | "Query" | "Header" => {
330+
"Vec" | "HashSet" | "BTreeSet" | "Option" | "Result" | "Json" | "Path"
331+
| "Query" | "Header" => {
331332
// These are not schema types, return object schema
332333
SchemaRef::Inline(Box::new(Schema::new(SchemaType::Object)))
333334
}

crates/vespera_macro/src/schema_macro/input.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
//! Defines input structures for `schema!` and `schema_type!` macros.
44
55
use syn::{
6-
bracketed, parenthesized,
6+
Ident, LitStr, Token, Type, bracketed, parenthesized,
77
parse::{Parse, ParseStream},
88
punctuated::Punctuated,
9-
Ident, LitStr, Token, Type,
109
};
1110

1211
/// Input for the schema! macro

crates/vespera_macro/src/schema_macro/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,8 +779,8 @@ fn sql_function_default_for_type(original_ty: &syn::Type) -> Option<(TokenStream
779779
quote! { Default::default() },
780780
"00000000-0000-0000-0000-000000000000".to_string(),
781781
)),
782-
"i8" | "i16" | "i32" | "i64" | "i128" | "isize" | "u8" | "u16" | "u32" | "u64"
783-
| "u128" | "usize" | "f32" | "f64" | "Decimal" => {
782+
"i8" | "i16" | "i32" | "i64" | "i128" | "isize" | "u8" | "u16" | "u32" | "u64" | "u128"
783+
| "usize" | "f32" | "f64" | "Decimal" => {
784784
Some((quote! { Default::default() }, "0".to_string()))
785785
}
786786
"bool" => Some((quote! { Default::default() }, "false".to_string())),

crates/vespera_macro/src/schema_macro/type_utils.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -640,10 +640,12 @@ mod tests {
640640
let ty = empty_type_path();
641641
let result = extract_type_name(&ty);
642642
assert!(result.is_err());
643-
assert!(result
644-
.unwrap_err()
645-
.to_string()
646-
.contains("type path has no segments"));
643+
assert!(
644+
result
645+
.unwrap_err()
646+
.to_string()
647+
.contains("type path has no segments")
648+
);
647649
}
648650

649651
#[test]

0 commit comments

Comments
 (0)