Skip to content

Commit e7d2c85

Browse files
committed
Run cargo fmt in derive crate
1 parent 93c9cb5 commit e7d2c85

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/rust.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- uses: actions/checkout@v4
2828
- name: Setup Rust Toolchain
2929
uses: ./.github/actions/setup-builder
30-
- run: cargo fmt -- --check
30+
- run: cargo fmt --all -- --check
3131

3232
lint:
3333
runs-on: ubuntu-latest

derive/src/lib.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
use proc_macro2::TokenStream;
1919
use quote::{format_ident, quote, quote_spanned, ToTokens};
2020
use syn::spanned::Spanned;
21-
use syn::{parse::{Parse, ParseStream}, parse_macro_input, parse_quote, Attribute, Data, DeriveInput, Fields, GenericParam, Generics, Ident, Index, LitStr, Meta, Token, Type, TypePath};
21+
use syn::{
22+
parse::{Parse, ParseStream},
23+
parse_macro_input, parse_quote, Attribute, Data, DeriveInput, Fields, GenericParam, Generics,
24+
Ident, Index, LitStr, Meta, Token, Type, TypePath,
25+
};
2226
use syn::{Path, PathArguments};
2327

2428
/// Implementation of `[#derive(Visit)]`
@@ -267,7 +271,11 @@ fn visit_children(
267271
}
268272

269273
fn is_option(ty: &Type) -> bool {
270-
if let Type::Path(TypePath { path: Path { segments, .. }, .. }) = ty {
274+
if let Type::Path(TypePath {
275+
path: Path { segments, .. },
276+
..
277+
}) = ty
278+
{
271279
if let Some(segment) = segments.last() {
272280
if segment.ident == "Option" {
273281
if let PathArguments::AngleBracketed(args) = &segment.arguments {

0 commit comments

Comments
 (0)