mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-08-04 19:08:32 +00:00
chore: Normalize imports style (#779)
* Default impl some ingredient functions * chore: Normalize imports style Effectively reformatted everything with ```toml imports_granularity = "Module" group_imports = "StdExternalCrate" reorder_imports = true ```
This commit is contained in:
parent
20a347e147
commit
a89e3d2357
78 changed files with 398 additions and 647 deletions
|
@ -1,10 +1,8 @@
|
|||
use proc_macro2::TokenStream;
|
||||
|
||||
use crate::{
|
||||
hygiene::Hygiene,
|
||||
options::{AllowedOptions, Options},
|
||||
token_stream_with_error,
|
||||
};
|
||||
use crate::hygiene::Hygiene;
|
||||
use crate::options::{AllowedOptions, Options};
|
||||
use crate::token_stream_with_error;
|
||||
|
||||
// #[salsa::accumulator(jar = Jar0)]
|
||||
// struct Accumulator(DataType);
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
use proc_macro2::TokenStream;
|
||||
use syn::parse::Nothing;
|
||||
|
||||
use crate::{hygiene::Hygiene, token_stream_with_error};
|
||||
use crate::hygiene::Hygiene;
|
||||
use crate::token_stream_with_error;
|
||||
|
||||
// Source:
|
||||
//
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
use crate::{hygiene::Hygiene, xform::ChangeLt};
|
||||
use crate::hygiene::Hygiene;
|
||||
use crate::xform::ChangeLt;
|
||||
|
||||
/// Returns a vector of ids representing the function arguments.
|
||||
/// Prefers to reuse the names given by the user, if possible.
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
use crate::{
|
||||
hygiene::Hygiene,
|
||||
options::Options,
|
||||
salsa_struct::{SalsaStruct, SalsaStructAllowedOptions},
|
||||
token_stream_with_error,
|
||||
};
|
||||
use proc_macro2::TokenStream;
|
||||
|
||||
use crate::hygiene::Hygiene;
|
||||
use crate::options::Options;
|
||||
use crate::salsa_struct::{SalsaStruct, SalsaStructAllowedOptions};
|
||||
use crate::token_stream_with_error;
|
||||
|
||||
/// For an entity struct `Foo` with fields `f1: T1, ..., fN: TN`, we generate...
|
||||
///
|
||||
/// * the "id struct" `struct Foo(salsa::Id)`
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
use crate::{
|
||||
db_lifetime,
|
||||
hygiene::Hygiene,
|
||||
options::Options,
|
||||
salsa_struct::{SalsaStruct, SalsaStructAllowedOptions},
|
||||
token_stream_with_error,
|
||||
};
|
||||
use proc_macro2::TokenStream;
|
||||
|
||||
use crate::hygiene::Hygiene;
|
||||
use crate::options::Options;
|
||||
use crate::salsa_struct::{SalsaStruct, SalsaStructAllowedOptions};
|
||||
use crate::{db_lifetime, token_stream_with_error};
|
||||
|
||||
/// For an entity struct `Foo` with fields `f1: T1, ..., fN: TN`, we generate...
|
||||
///
|
||||
/// * the "id struct" `struct Foo(salsa::Id)`
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use std::marker::PhantomData;
|
||||
|
||||
use syn::{ext::IdentExt, spanned::Spanned};
|
||||
use syn::ext::IdentExt;
|
||||
use syn::spanned::Spanned;
|
||||
|
||||
/// "Options" are flags that can be supplied to the various salsa related
|
||||
/// macros. They are listed like `(ref, no_eq, foo=bar)` etc. The commas
|
||||
|
|
|
@ -25,12 +25,11 @@
|
|||
//! * data method `impl Foo { fn data(&self, db: &dyn crate::Db) -> FooData { FooData { f: self.f(db), ... } } }`
|
||||
//! * this could be optimized, particularly for interned fields
|
||||
|
||||
use crate::{
|
||||
db_lifetime,
|
||||
options::{AllowedOptions, Options},
|
||||
};
|
||||
use proc_macro2::{Ident, Literal, Span, TokenStream};
|
||||
|
||||
use crate::db_lifetime;
|
||||
use crate::options::{AllowedOptions, Options};
|
||||
|
||||
pub(crate) struct SalsaStruct<'s, A: SalsaStructAllowedOptions> {
|
||||
struct_item: &'s syn::ItemStruct,
|
||||
args: &'s Options<A>,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use crate::token_stream_with_error;
|
||||
use proc_macro2::TokenStream;
|
||||
|
||||
use crate::token_stream_with_error;
|
||||
|
||||
/// The implementation of the `supertype` macro.
|
||||
///
|
||||
/// For an entity enum `Foo` with variants `Variant1, ..., VariantN`, we generate
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
use syn::{spanned::Spanned, Item};
|
||||
use syn::spanned::Spanned;
|
||||
use syn::Item;
|
||||
|
||||
use crate::token_stream_with_error;
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
use proc_macro2::{Literal, Span, TokenStream};
|
||||
use quote::ToTokens;
|
||||
use syn::{spanned::Spanned, ItemFn};
|
||||
use syn::spanned::Spanned;
|
||||
use syn::ItemFn;
|
||||
|
||||
use crate::{db_lifetime, fn_util, hygiene::Hygiene, options::Options};
|
||||
use crate::hygiene::Hygiene;
|
||||
use crate::options::Options;
|
||||
use crate::{db_lifetime, fn_util};
|
||||
|
||||
// Source:
|
||||
//
|
||||
|
|
|
@ -2,9 +2,12 @@ use std::collections::HashSet;
|
|||
|
||||
use proc_macro2::TokenStream;
|
||||
use quote::ToTokens;
|
||||
use syn::{parse::Nothing, visit_mut::VisitMut};
|
||||
use syn::parse::Nothing;
|
||||
use syn::visit_mut::VisitMut;
|
||||
|
||||
use crate::{hygiene::Hygiene, tracked_fn::FnArgs, xform::ChangeSelfPath};
|
||||
use crate::hygiene::Hygiene;
|
||||
use crate::tracked_fn::FnArgs;
|
||||
use crate::xform::ChangeSelfPath;
|
||||
|
||||
pub(crate) fn tracked_impl(
|
||||
args: proc_macro::TokenStream,
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
use crate::{
|
||||
db_lifetime,
|
||||
hygiene::Hygiene,
|
||||
options::Options,
|
||||
salsa_struct::{SalsaStruct, SalsaStructAllowedOptions},
|
||||
};
|
||||
use proc_macro2::TokenStream;
|
||||
|
||||
use crate::db_lifetime;
|
||||
use crate::hygiene::Hygiene;
|
||||
use crate::options::Options;
|
||||
use crate::salsa_struct::{SalsaStruct, SalsaStructAllowedOptions};
|
||||
|
||||
/// For an entity struct `Foo` with fields `f1: T1, ..., fN: TN`, we generate...
|
||||
///
|
||||
/// * the "id struct" `struct Foo(salsa::Id)`
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
use std::collections::HashSet;
|
||||
|
||||
use quote::ToTokens;
|
||||
use syn::{punctuated::Punctuated, spanned::Spanned, visit_mut::VisitMut};
|
||||
use syn::punctuated::Punctuated;
|
||||
use syn::spanned::Spanned;
|
||||
use syn::visit_mut::VisitMut;
|
||||
|
||||
pub(crate) struct ChangeLt<'a> {
|
||||
from: Option<&'a str>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue