mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-07 17:04:59 +00:00
Run cargo fmt in derive crate
This commit is contained in:
parent
93c9cb5eed
commit
e7d2c85291
2 changed files with 11 additions and 3 deletions
2
.github/workflows/rust.yml
vendored
2
.github/workflows/rust.yml
vendored
|
@ -27,7 +27,7 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup Rust Toolchain
|
- name: Setup Rust Toolchain
|
||||||
uses: ./.github/actions/setup-builder
|
uses: ./.github/actions/setup-builder
|
||||||
- run: cargo fmt -- --check
|
- run: cargo fmt --all -- --check
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
@ -18,7 +18,11 @@
|
||||||
use proc_macro2::TokenStream;
|
use proc_macro2::TokenStream;
|
||||||
use quote::{format_ident, quote, quote_spanned, ToTokens};
|
use quote::{format_ident, quote, quote_spanned, ToTokens};
|
||||||
use syn::spanned::Spanned;
|
use syn::spanned::Spanned;
|
||||||
use syn::{parse::{Parse, ParseStream}, parse_macro_input, parse_quote, Attribute, Data, DeriveInput, Fields, GenericParam, Generics, Ident, Index, LitStr, Meta, Token, Type, TypePath};
|
use syn::{
|
||||||
|
parse::{Parse, ParseStream},
|
||||||
|
parse_macro_input, parse_quote, Attribute, Data, DeriveInput, Fields, GenericParam, Generics,
|
||||||
|
Ident, Index, LitStr, Meta, Token, Type, TypePath,
|
||||||
|
};
|
||||||
use syn::{Path, PathArguments};
|
use syn::{Path, PathArguments};
|
||||||
|
|
||||||
/// Implementation of `[#derive(Visit)]`
|
/// Implementation of `[#derive(Visit)]`
|
||||||
|
@ -267,7 +271,11 @@ fn visit_children(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_option(ty: &Type) -> bool {
|
fn is_option(ty: &Type) -> bool {
|
||||||
if let Type::Path(TypePath { path: Path { segments, .. }, .. }) = ty {
|
if let Type::Path(TypePath {
|
||||||
|
path: Path { segments, .. },
|
||||||
|
..
|
||||||
|
}) = ty
|
||||||
|
{
|
||||||
if let Some(segment) = segments.last() {
|
if let Some(segment) = segments.last() {
|
||||||
if segment.ident == "Option" {
|
if segment.ident == "Option" {
|
||||||
if let PathArguments::AngleBracketed(args) = &segment.arguments {
|
if let PathArguments::AngleBracketed(args) = &segment.arguments {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue