Skip to content

Commit

Permalink
Reformatted Imports with RustRover
Browse files Browse the repository at this point in the history
  • Loading branch information
Redfire75369 committed Aug 16, 2024
1 parent c82af99 commit 7bc490f
Show file tree
Hide file tree
Showing 134 changed files with 285 additions and 285 deletions.
2 changes: 1 addition & 1 deletion cli/src/commands/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::fs::{metadata, read_dir};
use std::io;
use std::path::Path;

use humansize::{BINARY, SizeFormatter};
use humansize::{SizeFormatter, BINARY};

use runtime::cache::Cache;

Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

use runtime::cache::Cache;
use runtime::config::{Config, CONFIG, LogLevel};
use runtime::config::{Config, LogLevel, CONFIG};

use crate::{Cli, Command};

Expand Down
4 changes: 2 additions & 2 deletions cli/src/commands/repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
*/

use mozjs::rust::{JSEngine, Runtime};
use rustyline::Editor;
use rustyline::error::ReadlineError;
use rustyline::Editor;

use ion::Context;
use modules::Modules;
use runtime::RuntimeBuilder;

use crate::evaluate::eval_inline;
use crate::repl::{ReplHelper, rustyline_config};
use crate::repl::{rustyline_config, ReplHelper};

pub(crate) async fn start_repl() {
let engine = JSEngine::init().unwrap();
Expand Down
6 changes: 3 additions & 3 deletions cli/src/evaluate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ use mozjs::rust::JSEngine;
use mozjs::rust::Runtime as RustRuntime;
use sourcemap::SourceMap;

use ion::Context;
use ion::format::Config as FormatConfig;
use ion::format::format_value;
use ion::format::Config as FormatConfig;
use ion::module::Module;
use ion::script::Script;
use ion::Context;
use modules::Modules;
use runtime::{Runtime, RuntimeBuilder};
use runtime::cache::locate_in_cache;
use runtime::cache::map::{save_sourcemap, transform_error_report_with_sourcemaps};
use runtime::config::Config;
use runtime::module::Loader;
use runtime::{Runtime, RuntimeBuilder};

pub(crate) async fn eval_inline(rt: &Runtime<'_>, source: &str) {
let result = Script::compile_and_evaluate(rt.cx(), Path::new("inline.js"), source);
Expand Down
2 changes: 1 addition & 1 deletion cli/src/repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

use rustyline::{Config, Result};
use rustyline::config::Builder;
use rustyline::validate::{MatchingBracketValidator, ValidationContext, ValidationResult, Validator};
use rustyline::{Config, Result};
use rustyline_derive::{Completer, Helper, Highlighter, Hinter};

#[derive(Completer, Helper, Hinter, Highlighter)]
Expand Down
4 changes: 2 additions & 2 deletions ion-proc/src/attribute/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

use syn::{LitStr, Result};
use syn::meta::ParseNestedMeta;
use syn::{LitStr, Result};

use crate::attribute::{ArgumentError, ParseArgument, ParseArgumentWith, ParseAttribute};
use crate::attribute::name::Name;
use crate::attribute::{ArgumentError, ParseArgument, ParseArgumentWith, ParseAttribute};
use crate::class::method::MethodKind;

// TODO: Add `inspectable` to provide `toString` and `toJSON`
Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/attribute/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

use syn::{Expr, Result};
use syn::meta::ParseNestedMeta;
use syn::{Expr, Result};

use crate::attribute::{ParseArgument, ParseAttribute};

Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/attribute/krate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/

use proc_macro2::{Ident, TokenStream};
use syn::{Attribute, Result};
use syn::meta::ParseNestedMeta;
use syn::{Attribute, Result};

use crate::attribute::{ParseArgument, ParseAttribute};

Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/attribute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*/

use proc_macro2::Ident;
use syn::{Attribute, Result};
use syn::meta::ParseNestedMeta;
use syn::parse::Parse;
use syn::punctuated::Punctuated;
use syn::{Attribute, Result};

pub(crate) mod class;
pub(crate) mod function;
Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/attribute/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

use convert_case::{Case, Casing};
use proc_macro2::{Ident, Span, TokenStream};
use syn::{Error, Expr, ExprLit, ExprPath, Lit, LitStr};
use syn::parse::{Parse, ParseStream};
use syn::{Error, Expr, ExprLit, ExprPath, Lit, LitStr};

#[derive(Clone)]
pub(crate) enum Name {
Expand Down
4 changes: 2 additions & 2 deletions ion-proc/src/attribute/property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

use syn::{LitStr, Result};
use syn::meta::ParseNestedMeta;
use syn::{LitStr, Result};

use crate::attribute::{ParseArgument, ParseAttribute};
use crate::attribute::name::Name;
use crate::attribute::{ParseArgument, ParseAttribute};

#[derive(Default)]
pub(crate) struct PropertyAttribute {
Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/attribute/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

use syn::{Expr, ExprClosure, Lit, LitStr, Result};
use syn::meta::ParseNestedMeta;
use syn::parse::{Parse, ParseStream};
use syn::{Expr, ExprClosure, Lit, LitStr, Result};

use crate::attribute::{ArgumentError, Optional, ParseArgument, ParseArgumentWith, ParseAttribute};

Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/class/accessor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use std::collections::HashMap;

use convert_case::{Case, Casing};
use proc_macro2::{Ident, TokenStream};
use syn::{Error, ItemFn, Result, Type};
use syn::spanned::Spanned;
use syn::{Error, ItemFn, Result, Type};

use crate::class::method::{impl_method, Method};
use crate::function::parameter::Parameters;
Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/class/constructor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use proc_macro2::TokenStream;
use syn::{ItemFn, Result, Type};

use crate::class::method::{Method, MethodReceiver};
use crate::function::{check_abi, set_signature};
use crate::function::wrapper::impl_wrapper_fn;
use crate::function::{check_abi, set_signature};

pub(super) fn impl_constructor(ion: &TokenStream, mut constructor: ItemFn, ty: &Type) -> Result<Method> {
let (wrapper, parameters) = impl_wrapper_fn(ion, constructor.clone(), Some(ty), true)?;
Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/class/impl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

use proc_macro2::{Ident, Span, TokenStream};
use quote::ToTokens;
use syn::{Error, FnArg, ImplItem, ImplItemFn, ItemFn, ItemImpl, parse2, Result, Type, Visibility};
use syn::spanned::Spanned;
use syn::{parse2, Error, FnArg, ImplItem, ImplItemFn, ItemFn, ItemImpl, Result, Type, Visibility};

use crate::attribute::class::MethodAttribute;
use crate::attribute::krate::crate_from_attributes;
Expand Down
4 changes: 2 additions & 2 deletions ion-proc/src/class/impl/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
use std::collections::HashMap;

use proc_macro2::{Ident, Span, TokenStream};
use syn::{ImplItemFn, parse2, Result, Type};
use syn::{parse2, ImplItemFn, Result, Type};

use crate::class::accessor::{Accessor, flatten_accessors};
use crate::class::accessor::{flatten_accessors, Accessor};
use crate::class::method::Method;
use crate::class::property::Property;

Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/class/method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ use proc_macro2::{Ident, TokenStream};
use syn::{ItemFn, Result, Signature, Type};

use crate::attribute::name::Name;
use crate::function::{check_abi, impl_fn_body, set_signature};
use crate::function::parameter::Parameters;
use crate::function::wrapper::impl_wrapper_fn;
use crate::function::{check_abi, impl_fn_body, set_signature};

#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub(crate) enum MethodKind {
Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/class/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/

use proc_macro2::TokenStream;
use syn::{Error, Item, Result};
use syn::spanned::Spanned;
use syn::{Error, Item, Result};

use crate::class::r#impl::impl_js_class_impl;
use crate::class::r#struct::impl_js_class_struct;
Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/class/property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use proc_macro2::{Ident, TokenStream};
use syn::{ImplItemConst, Result, Type};

use crate::attribute::name::Name;
use crate::attribute::ParseAttribute;
use crate::attribute::property::PropertyAttribute;
use crate::attribute::ParseAttribute;
use crate::utils::path_ends_with;

#[derive(Clone, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/class/struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/

use proc_macro2::{Ident, Span, TokenStream};
use syn::{Error, ItemImpl, ItemStruct, Member, parse2, Path, Result, Type};
use syn::punctuated::Punctuated;
use syn::spanned::Spanned;
use syn::{parse2, Error, ItemImpl, ItemStruct, Member, Path, Result, Type};

use crate::attribute::class::ClassAttribute;
use crate::attribute::krate::crate_from_attributes;
Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/function/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

use syn::ItemFn;
use syn::punctuated::Punctuated;
use syn::ItemFn;

use crate::function::parameter::Parameters;

Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/function/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/

use proc_macro2::TokenStream;
use syn::{Abi, Block, Error, FnArg, Generics, ItemFn, parse2, Result};
use syn::punctuated::Punctuated;
use syn::{parse2, Abi, Block, Error, FnArg, Generics, ItemFn, Result};

use crate::attribute::krate::crate_from_attributes;
use crate::function::wrapper::impl_wrapper_fn;
Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/function/parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*/

use proc_macro2::{Span, TokenStream};
use syn::{Error, Expr, FnArg, Ident, parse2, Pat, PatType, Receiver, Result, Stmt, Type};
use syn::punctuated::Punctuated;
use syn::spanned::Spanned;
use syn::visit_mut::visit_type_mut;
use syn::{parse2, Error, Expr, FnArg, Ident, Pat, PatType, Receiver, Result, Stmt, Type};

use crate::attribute::function::ParameterAttribute;
use crate::attribute::ParseAttribute;
Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/function/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

use proc_macro2::TokenStream;
use quote::ToTokens;
use syn::{Error, FnArg, GenericParam, ItemFn, parse2, Result, ReturnType, Type};
use syn::punctuated::Punctuated;
use syn::spanned::Spanned;
use syn::{parse2, Error, FnArg, GenericParam, ItemFn, Result, ReturnType, Type};

use crate::function::inner::impl_inner_fn;
use crate::function::parameter::Parameters;
Expand Down
4 changes: 2 additions & 2 deletions ion-proc/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
*/

use proc_macro2::{Ident, Span};
use syn::{Arm, Block, Data, DeriveInput, Error, Fields, Generics, ItemImpl, parse2, Result};
use syn::spanned::Spanned;
use syn::{parse2, Arm, Block, Data, DeriveInput, Error, Fields, Generics, ItemImpl, Result};

use crate::attribute::ParseAttribute;
use crate::attribute::trace::TraceAttribute;
use crate::attribute::ParseAttribute;
use crate::utils::add_trait_bounds;

pub(super) fn impl_trace(mut input: DeriveInput) -> Result<ItemImpl> {
Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use prettyplease::unparse;
use proc_macro2::Ident;
use syn::{GenericParam, Generics, parse2, Pat, Path, Type, TypeParamBound};
use syn::{parse2, GenericParam, Generics, Pat, Path, Type, TypeParamBound};

pub(crate) fn path_ends_with<I: ?Sized>(path: &Path, ident: &I) -> bool
where
Expand Down
4 changes: 2 additions & 2 deletions ion-proc/src/value/from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

use convert_case::{Case, Casing};
use proc_macro2::{Ident, Span, TokenStream};
use syn::{Block, Data, DeriveInput, Error, Field, Fields, GenericParam, Generics, ItemImpl, Meta, parse2, Result, Type};
use syn::punctuated::Punctuated;
use syn::spanned::Spanned;
use syn::{parse2, Block, Data, DeriveInput, Error, Field, Fields, GenericParam, Generics, ItemImpl, Meta, Result, Type};

use crate::attribute::{Optional, ParseAttribute};
use crate::attribute::krate::crate_from_attributes;
use crate::attribute::value::{DataAttribute, DefaultValue, FieldAttribute, Tag, VariantAttribute};
use crate::attribute::{Optional, ParseAttribute};
use crate::utils::{add_trait_bounds, format_type, path_ends_with};

pub(crate) fn impl_from_value(mut input: DeriveInput) -> Result<ItemImpl> {
Expand Down
2 changes: 1 addition & 1 deletion ion-proc/src/visitors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

use syn::{GenericArgument, PathArguments, Type, TypePath, TypeReference};
use syn::punctuated::Punctuated;
use syn::visit_mut::{visit_type_mut, visit_type_path_mut, visit_type_reference_mut, VisitMut};
use syn::{GenericArgument, PathArguments, Type, TypePath, TypeReference};

use crate::utils::path_ends_with;

Expand Down
4 changes: 2 additions & 2 deletions ion/examples/macros/from_value/structure.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::sync::Arc;
use std::sync::atomic::AtomicU64;
use std::sync::Arc;

use ion::{Context, FromValue, Object, Result, Value};
use ion::conversions::{ConversionBehavior, FromValue};
use ion::function::{Enforce, Strict};
use ion::{Context, FromValue, Object, Result, Value};

#[derive(FromValue)]
pub struct Complex<'cx> {
Expand Down
2 changes: 1 addition & 1 deletion ion/examples/macros/js_class/toggle.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ion::{Context, Function, js_class, Object, Result, Value};
use ion::class::Reflector;
use ion::conversions::FromValue;
use ion::{js_class, Context, Function, Object, Result, Value};

#[js_class]
#[derive(Debug, Default)]
Expand Down
2 changes: 1 addition & 1 deletion ion/examples/macros/js_fn/complex.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ion::{Context, Function, js_fn, Object, Promise, Value};
use ion::function::{Enforce, Rest, Strict};
use ion::{js_fn, Context, Function, Object, Promise, Value};

#[allow(clippy::too_many_arguments)]
#[js_fn]
Expand Down
2 changes: 1 addition & 1 deletion ion/examples/macros/js_fn/context.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use ion::{Arguments, Context, js_fn};
use ion::{js_fn, Arguments, Context};

#[js_fn]
pub fn context(_cx: &Context) {}
Expand Down
2 changes: 1 addition & 1 deletion ion/examples/macros/js_fn/output.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use ion::{Array, Context, js_fn, Object, Result, ResultExc};
use ion::{js_fn, Array, Context, Object, Result, ResultExc};

#[js_fn]
fn output_empty() {}
Expand Down
2 changes: 1 addition & 1 deletion ion/examples/macros/js_fn/varargs.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ion::{js_fn, Object};
use ion::function::{Enforce, Rest};
use ion::{js_fn, Object};

#[js_fn]
pub fn varargs(Rest(_strings): Rest<String>) {}
Expand Down
4 changes: 2 additions & 2 deletions ion/src/bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
use std::marker::PhantomData;
use std::ops::{Deref, DerefMut};

use mozjs::jsapi::mozilla::{Range, RangedPtr};
use mozjs::jsapi::BigInt as JSBigInt;
use mozjs::jsapi::{
BigIntFitsNumber, BigIntFromBool, BigIntFromInt64, BigIntFromUint64, BigIntIsInt64, BigIntIsNegative,
BigIntIsUint64, BigIntToNumber, BigIntToString, NumberToBigInt, StringToBigInt1,
};
use mozjs::jsapi::BigInt as JSBigInt;
use mozjs::jsapi::mozilla::{Range, RangedPtr};

use crate::{Context, Exception, Local, String};

Expand Down
Loading

0 comments on commit 7bc490f

Please sign in to comment.