You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by al...@apache.org on 2024/12/13 12:22:36 UTC

(datafusion-sqlparser-rs) branch main updated: Run cargo fmt on `derive` crate (#1595)

This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new 31088286 Run cargo fmt on `derive` crate (#1595)
31088286 is described below

commit 310882862147ad7ca43320da049a718c9a4538b0
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Fri Dec 13 07:22:30 2024 -0500

    Run cargo fmt on `derive` crate (#1595)
---
 .github/workflows/rust.yml |  2 +-
 derive/src/lib.rs          | 12 ++++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 2502abe9..6c8130dc 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -27,7 +27,7 @@ jobs:
       - uses: actions/checkout@v4
       - name: Setup Rust Toolchain
         uses: ./.github/actions/setup-builder
-      - run: cargo fmt -- --check 
+      - run: cargo fmt --all -- --check
 
   lint:
     runs-on: ubuntu-latest
diff --git a/derive/src/lib.rs b/derive/src/lib.rs
index dd4d37b4..b8162331 100644
--- a/derive/src/lib.rs
+++ b/derive/src/lib.rs
@@ -18,7 +18,11 @@
 use proc_macro2::TokenStream;
 use quote::{format_ident, quote, quote_spanned, ToTokens};
 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};
 
 /// Implementation of `[#derive(Visit)]`
@@ -267,7 +271,11 @@ fn visit_children(
 }
 
 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 segment.ident == "Option" {
                 if let PathArguments::AngleBracketed(args) = &segment.arguments {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org