diff --git a/Cargo.lock b/Cargo.lock index 07871b5..03a79ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1850,7 +1850,7 @@ dependencies = [ "hyperdb-compile-check", "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.5", "trybuild", ] diff --git a/hyperdb-api-derive/Cargo.toml b/hyperdb-api-derive/Cargo.toml index a01c6f4..626e2f3 100644 --- a/hyperdb-api-derive/Cargo.toml +++ b/hyperdb-api-derive/Cargo.toml @@ -23,7 +23,7 @@ proc-macro = true compile-time = ["dep:hyperdb-compile-check"] [dependencies] -syn = { version = "2", features = ["full"] } +syn = { version = "3", features = ["full"] } quote = "1" proc-macro2 = "1" # x-release-please-start-version diff --git a/hyperdb-api-derive/src/lib.rs b/hyperdb-api-derive/src/lib.rs index de82d58..a93acf4 100644 --- a/hyperdb-api-derive/src/lib.rs +++ b/hyperdb-api-derive/src/lib.rs @@ -187,7 +187,10 @@ fn expand_query_as(input: &TokenStream2) -> syn::Result { /// Only needed when `compile-time` feature is enabled (used for registry lookup). #[cfg(feature = "compile-time")] fn last_type_ident(ty: &Type) -> Option<&syn::Ident> { - let Type::Path(syn::TypePath { path, qself: None }) = ty else { + let Type::Path(syn::TypePath { + path, qself: None, .. + }) = ty + else { return None; }; path.segments.last().map(|s| &s.ident) @@ -397,7 +400,10 @@ fn field_source_for(field: &Field, default: &syn::Ident) -> syn::Result` (any path ending in `Option`). fn is_option_type(ty: &Type) -> bool { - let Type::Path(TypePath { path, qself: None }) = ty else { + let Type::Path(TypePath { + path, qself: None, .. + }) = ty + else { return false; }; let Some(last) = path.segments.last() else { diff --git a/hyperdb-api-derive/src/table_derive.rs b/hyperdb-api-derive/src/table_derive.rs index 4df6852..5e4e8bf 100644 --- a/hyperdb-api-derive/src/table_derive.rs +++ b/hyperdb-api-derive/src/table_derive.rs @@ -302,7 +302,10 @@ fn rust_type_to_sql<'a>(field: &Field, ty: &'a Type) -> syn::Result<&'a str> { /// If `ty` is `Option`, return `(T, true)`. Otherwise return `(ty, false)`. fn unwrap_option(ty: &Type) -> (&Type, bool) { - let Type::Path(TypePath { path, qself: None }) = ty else { + let Type::Path(TypePath { + path, qself: None, .. + }) = ty + else { return (ty, false); }; let Some(last) = path.segments.last() else { @@ -323,7 +326,10 @@ fn unwrap_option(ty: &Type) -> (&Type, bool) { /// Returns `true` if `ty` is exactly `Vec` (the only `Vec<_>` that maps to BYTES). fn is_vec_u8(ty: &Type) -> bool { - let Type::Path(TypePath { path, qself: None }) = ty else { + let Type::Path(TypePath { + path, qself: None, .. + }) = ty + else { return false; }; let Some(last) = path.segments.last() else { @@ -337,14 +343,17 @@ fn is_vec_u8(ty: &Type) -> bool { }; matches!( args.args.first(), - Some(GenericArgument::Type(Type::Path(TypePath { path, qself: None }))) + Some(GenericArgument::Type(Type::Path(TypePath { path, qself: None, .. }))) if path.is_ident("u8") ) } /// Extract the last path segment ident from a type, if it's a simple `TypePath`. fn last_path_ident(ty: &Type) -> Option<&syn::Ident> { - let Type::Path(TypePath { path, qself: None }) = ty else { + let Type::Path(TypePath { + path, qself: None, .. + }) = ty + else { return None; }; path.segments.last().map(|s| &s.ident)