diff options
Diffstat (limited to 'ops')
-rw-r--r-- | ops/attrs.rs | 12 | ||||
-rw-r--r-- | ops/deno.rs | 6 | ||||
-rw-r--r-- | ops/fast_call.rs | 24 | ||||
-rw-r--r-- | ops/lib.rs | 26 | ||||
-rw-r--r-- | ops/optimizer.rs | 30 |
5 files changed, 69 insertions, 29 deletions
diff --git a/ops/attrs.rs b/ops/attrs.rs index 93fbb05ff..a76cfddf6 100644 --- a/ops/attrs.rs +++ b/ops/attrs.rs @@ -1,9 +1,11 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -use syn::{ - parse::{Parse, ParseStream}, - punctuated::Punctuated, - Error, Ident, Result, Token, -}; +use syn::parse::Parse; +use syn::parse::ParseStream; +use syn::punctuated::Punctuated; +use syn::Error; +use syn::Ident; +use syn::Result; +use syn::Token; #[derive(Copy, Clone, Debug, Default)] pub struct Attributes { diff --git a/ops/deno.rs b/ops/deno.rs index 710fd430f..73f4c0611 100644 --- a/ops/deno.rs +++ b/ops/deno.rs @@ -1,8 +1,10 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. #![cfg(not(test))] -use proc_macro2::{Span, TokenStream}; -use proc_macro_crate::{crate_name, FoundCrate}; +use proc_macro2::Span; +use proc_macro2::TokenStream; +use proc_macro_crate::crate_name; +use proc_macro_crate::FoundCrate; use quote::quote; use syn::Ident; diff --git a/ops/fast_call.rs b/ops/fast_call.rs index ce7a28210..9384761a1 100644 --- a/ops/fast_call.rs +++ b/ops/fast_call.rs @@ -1,13 +1,25 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. //! Code generation for V8 fast calls. -use pmutil::{q, Quote, ToTokensExt}; -use proc_macro2::{Span, TokenStream}; +use pmutil::q; +use pmutil::Quote; +use pmutil::ToTokensExt; +use proc_macro2::Span; +use proc_macro2::TokenStream; use quote::quote; -use syn::{ - parse_quote, punctuated::Punctuated, token::Comma, GenericParam, Generics, - Ident, ItemFn, ItemImpl, Path, PathArguments, PathSegment, Type, TypePath, -}; +use syn::parse_quote; +use syn::punctuated::Punctuated; +use syn::token::Comma; +use syn::GenericParam; +use syn::Generics; +use syn::Ident; +use syn::ItemFn; +use syn::ItemImpl; +use syn::Path; +use syn::PathArguments; +use syn::PathSegment; +use syn::Type; +use syn::TypePath; use crate::optimizer::FastValue; use crate::optimizer::Optimizer; diff --git a/ops/lib.rs b/ops/lib.rs index c16893366..5b215ed70 100644 --- a/ops/lib.rs +++ b/ops/lib.rs @@ -2,15 +2,24 @@ use attrs::Attributes; use once_cell::sync::Lazy; -use optimizer::{BailoutReason, Optimizer}; +use optimizer::BailoutReason; +use optimizer::Optimizer; use proc_macro::TokenStream; -use proc_macro2::{Span, TokenStream as TokenStream2}; -use quote::{quote, ToTokens}; +use proc_macro2::Span; +use proc_macro2::TokenStream as TokenStream2; +use quote::quote; +use quote::ToTokens; use regex::Regex; -use syn::{ - parse, parse_macro_input, punctuated::Punctuated, token::Comma, FnArg, - GenericParam, Ident, ItemFn, Lifetime, LifetimeDef, -}; +use syn::parse; +use syn::parse_macro_input; +use syn::punctuated::Punctuated; +use syn::token::Comma; +use syn::FnArg; +use syn::GenericParam; +use syn::Ident; +use syn::ItemFn; +use syn::Lifetime; +use syn::LifetimeDef; mod attrs; mod deno; @@ -747,7 +756,8 @@ fn exclude_lifetime_params( #[cfg(test)] mod tests { - use crate::{Attributes, Op}; + use crate::Attributes; + use crate::Op; use std::path::PathBuf; #[testing_macros::fixture("optimizer_tests/**/*.rs")] diff --git a/ops/optimizer.rs b/ops/optimizer.rs index 3f22a867b..1a6172b67 100644 --- a/ops/optimizer.rs +++ b/ops/optimizer.rs @@ -5,15 +5,28 @@ use std::collections::BTreeMap; use std::fmt::Debug; use std::fmt::Formatter; -use pmutil::{q, Quote}; +use pmutil::q; +use pmutil::Quote; use proc_macro2::TokenStream; -use syn::{ - parse_quote, punctuated::Punctuated, token::Colon2, - AngleBracketedGenericArguments, FnArg, GenericArgument, PatType, Path, - PathArguments, PathSegment, ReturnType, Signature, Type, TypePath, TypePtr, - TypeReference, TypeSlice, TypeTuple, -}; +use syn::parse_quote; +use syn::punctuated::Punctuated; +use syn::token::Colon2; +use syn::AngleBracketedGenericArguments; +use syn::FnArg; +use syn::GenericArgument; +use syn::PatType; +use syn::Path; +use syn::PathArguments; +use syn::PathSegment; +use syn::ReturnType; +use syn::Signature; +use syn::Type; +use syn::TypePath; +use syn::TypePtr; +use syn::TypeReference; +use syn::TypeSlice; +use syn::TypeTuple; use crate::Op; @@ -678,7 +691,8 @@ fn double_segment( #[cfg(test)] mod tests { use super::*; - use crate::{Attributes, Op}; + use crate::Attributes; + use crate::Op; use std::path::PathBuf; use syn::parse_quote; |