mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-13 11:35:00 +00:00
Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e7d2c85291 | ||
![]() |
93c9cb5eed |
3 changed files with 28 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 {
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
// Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
// or more contributor license agreements. See the NOTICE file
|
||||||
|
// distributed with this work for additional information
|
||||||
|
// regarding copyright ownership. The ASF licenses this file
|
||||||
|
// to you under the Apache License, Version 2.0 (the
|
||||||
|
// "License"); you may not use this file except in compliance
|
||||||
|
// with the License. You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing,
|
||||||
|
// software distributed under the License is distributed on an
|
||||||
|
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
// KIND, either express or implied. See the License for the
|
||||||
|
// specific language governing permissions and limitations
|
||||||
|
// under the License.
|
||||||
|
|
||||||
use core::iter;
|
use core::iter;
|
||||||
|
|
||||||
use crate::tokenizer::Span;
|
use crate::tokenizer::Span;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue