diff --git a/cli/core/build.rs b/cli/core/build.rs index bccb4f9ee..bbd4fdd9d 100644 --- a/cli/core/build.rs +++ b/cli/core/build.rs @@ -1,9 +1,11 @@ -use std::env; -use std::env::current_dir; -use std::error::Error; -use std::fs::{read_to_string, File}; -use std::io::{BufWriter, Write}; -use std::path::Path; +use std::{ + env, + env::current_dir, + error::Error, + fs::{read_to_string, File}, + io::{BufWriter, Write}, + path::Path, +}; pub fn main() -> Result<(), Box> { let out_dir = env::var("OUT_DIR")?; diff --git a/cli/core/src/build.rs b/cli/core/src/build.rs index 0c82965a1..efb5c2958 100644 --- a/cli/core/src/build.rs +++ b/cli/core/src/build.rs @@ -10,11 +10,13 @@ use crate::helpers::{ manifest::rewrite_manifest, TauriScript, }; -use std::env::{set_current_dir, set_var}; -use std::fs::File; -use std::io::Write; -use std::path::PathBuf; -use std::process::Command; +use std::{ + env::{set_current_dir, set_var}, + fs::File, + io::Write, + path::PathBuf, + process::Command, +}; #[derive(Default)] pub struct Build { diff --git a/cli/core/src/dev.rs b/cli/core/src/dev.rs index 34c41f1c1..e1f4298f1 100644 --- a/cli/core/src/dev.rs +++ b/cli/core/src/dev.rs @@ -8,15 +8,19 @@ use crate::helpers::{ use notify::{watcher, DebouncedEvent, RecursiveMode, Watcher}; use shared_child::SharedChild; -use std::env::{set_current_dir, set_var}; -use std::ffi::OsStr; -use std::fs::File; -use std::io::Write; -use std::path::PathBuf; -use std::process::{exit, Command}; -use std::sync::mpsc::{channel, Receiver}; -use std::sync::{Arc, Mutex}; -use std::time::Duration; +use std::{ + env::{set_current_dir, set_var}, + ffi::OsStr, + fs::File, + io::Write, + path::PathBuf, + process::{exit, Command}, + sync::{ + mpsc::{channel, Receiver}, + Arc, Mutex, + }, + time::Duration, +}; #[derive(Default)] pub struct Dev { diff --git a/cli/core/src/helpers/app_paths.rs b/cli/core/src/helpers/app_paths.rs index 15a7e67e0..03445227a 100644 --- a/cli/core/src/helpers/app_paths.rs +++ b/cli/core/src/helpers/app_paths.rs @@ -1,5 +1,4 @@ -use std::env::current_dir; -use std::path::PathBuf; +use std::{env::current_dir, path::PathBuf}; use once_cell::sync::Lazy; diff --git a/cli/core/src/helpers/config.rs b/cli/core/src/helpers/config.rs index d1f251fe8..42d8c60f9 100644 --- a/cli/core/src/helpers/config.rs +++ b/cli/core/src/helpers/config.rs @@ -1,14 +1,18 @@ use json_patch::merge; use once_cell::sync::Lazy; -use serde::de::{Deserializer, Error as DeError, Visitor}; -use serde::ser::Serializer; -use serde::{Deserialize, Serialize}; +use serde::{ + de::{Deserializer, Error as DeError, Visitor}, + ser::Serializer, + Deserialize, Serialize, +}; use serde_json::Value as JsonValue; -use std::collections::HashMap; -use std::fs::File; -use std::io::BufReader; -use std::sync::{Arc, Mutex}; +use std::{ + collections::HashMap, + fs::File, + io::BufReader, + sync::{Arc, Mutex}, +}; pub type ConfigHandle = Arc>>; diff --git a/cli/core/src/helpers/manifest.rs b/cli/core/src/helpers/manifest.rs index 6da725185..74b2a82e6 100644 --- a/cli/core/src/helpers/manifest.rs +++ b/cli/core/src/helpers/manifest.rs @@ -3,8 +3,10 @@ use super::{app_paths::tauri_dir, config::ConfigHandle}; use convert_case::{Case, Casing}; use toml_edit::{Array, Document, Value}; -use std::fs::File; -use std::io::{Read, Write}; +use std::{ + fs::File, + io::{Read, Write}, +}; pub fn rewrite_manifest(config: ConfigHandle) -> crate::Result<()> { let manifest_path = tauri_dir().join("Cargo.toml"); diff --git a/cli/core/src/helpers/mod.rs b/cli/core/src/helpers/mod.rs index 17ad8193f..802a48799 100644 --- a/cli/core/src/helpers/mod.rs +++ b/cli/core/src/helpers/mod.rs @@ -7,8 +7,10 @@ mod tauri_entry; pub use logger::Logger; pub use tauri_entry::TauriScript; -use std::io::{BufRead, BufReader}; -use std::process::{Command, Stdio}; +use std::{ + io::{BufRead, BufReader}, + process::{Command, Stdio}, +}; pub fn execute_with_output(cmd: &mut Command) -> crate::Result<()> { let mut child = cmd diff --git a/cli/core/src/init.rs b/cli/core/src/init.rs index de89f625b..5cfa9b4db 100644 --- a/cli/core/src/init.rs +++ b/cli/core/src/init.rs @@ -1,7 +1,6 @@ #![allow(dead_code)] -use std::convert::TryFrom; -use std::path::PathBuf; +use std::{convert::TryFrom, path::PathBuf}; pub enum ForceType { All, diff --git a/cli/tauri-bundler/rustfmt.toml b/cli/tauri-bundler/rustfmt.toml index 45642c190..136f5f330 100644 --- a/cli/tauri-bundler/rustfmt.toml +++ b/cli/tauri-bundler/rustfmt.toml @@ -11,3 +11,4 @@ merge_derives = true use_try_shorthand = false use_field_init_shorthand = false force_explicit_abi = true +imports_granularity = "Crate" diff --git a/cli/tauri-bundler/src/bundle.rs b/cli/tauri-bundler/src/bundle.rs index 6df85db29..f8ace1705 100644 --- a/cli/tauri-bundler/src/bundle.rs +++ b/cli/tauri-bundler/src/bundle.rs @@ -20,9 +20,10 @@ use std::process::Command; #[cfg(windows)] use tauri_config::get as get_tauri_config; -pub use self::common::print_error; -pub use self::common::print_info; -pub use self::settings::{PackageType, Settings, SettingsBuilder}; +pub use self::{ + common::{print_error, print_info}, + settings::{PackageType, Settings, SettingsBuilder}, +}; use common::print_finished; use std::path::PathBuf; diff --git a/cli/tauri-bundler/src/bundle/appimage_bundle.rs b/cli/tauri-bundler/src/bundle/appimage_bundle.rs index 5c6dfe6e0..0ee1a7d09 100644 --- a/cli/tauri-bundler/src/bundle/appimage_bundle.rs +++ b/cli/tauri-bundler/src/bundle/appimage_bundle.rs @@ -1,15 +1,15 @@ -use super::common; -use super::deb_bundle; -use super::path_utils; +use super::{common, deb_bundle, path_utils}; use crate::Settings; use handlebars::Handlebars; use lazy_static::lazy_static; -use std::collections::BTreeMap; -use std::fs::{remove_dir_all, write}; -use std::path::PathBuf; -use std::process::{Command, Stdio}; +use std::{ + collections::BTreeMap, + fs::{remove_dir_all, write}, + path::PathBuf, + process::{Command, Stdio}, +}; // Create handlebars template for shell script lazy_static! { diff --git a/cli/tauri-bundler/src/bundle/common.rs b/cli/tauri-bundler/src/bundle/common.rs index 5540c30d0..c9df7eae5 100644 --- a/cli/tauri-bundler/src/bundle/common.rs +++ b/cli/tauri-bundler/src/bundle/common.rs @@ -1,9 +1,11 @@ use crate::Settings; -use std::ffi::OsStr; -use std::fs::{self, File}; -use std::io::{self, BufRead, BufReader, BufWriter, Write}; -use std::path::{Component, Path, PathBuf}; -use std::process::{Command, Stdio}; +use std::{ + ffi::OsStr, + fs::{self, File}, + io::{self, BufRead, BufReader, BufWriter, Write}, + path::{Component, Path, PathBuf}, + process::{Command, Stdio}, +}; use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; /// Returns true if the path has a filename indicating that it is a high-desity @@ -246,8 +248,7 @@ pub fn execute_with_verbosity(cmd: &mut Command, settings: &Settings) -> crate:: #[cfg(test)] mod tests { use super::{copy_dir, create_file, is_retina, resource_relpath, symlink_file}; - use std::io::Write; - use std::path::PathBuf; + use std::{io::Write, path::PathBuf}; #[test] fn create_file_with_parent_dirs() { diff --git a/cli/tauri-bundler/src/bundle/deb_bundle.rs b/cli/tauri-bundler/src/bundle/deb_bundle.rs index 28e5b3f9d..56e872848 100644 --- a/cli/tauri-bundler/src/bundle/deb_bundle.rs +++ b/cli/tauri-bundler/src/bundle/deb_bundle.rs @@ -22,17 +22,18 @@ use super::common; use crate::Settings; use anyhow::Context; -use image::png::PngDecoder; -use image::{self, GenericImageView, ImageDecoder}; +use image::{self, png::PngDecoder, GenericImageView, ImageDecoder}; use libflate::gzip; use std::process::{Command, Stdio}; use walkdir::WalkDir; -use std::collections::BTreeSet; -use std::ffi::OsStr; -use std::fs::{self, File}; -use std::io::{self, Write}; -use std::path::{Path, PathBuf}; +use std::{ + collections::BTreeSet, + ffi::OsStr, + fs::{self, File}, + io::{self, Write}, + path::{Path, PathBuf}, +}; /// Bundles the project. /// Returns a vector of PathBuf that shows where the DEB was created. diff --git a/cli/tauri-bundler/src/bundle/dmg_bundle.rs b/cli/tauri-bundler/src/bundle/dmg_bundle.rs index 55339f664..fe65be15d 100644 --- a/cli/tauri-bundler/src/bundle/dmg_bundle.rs +++ b/cli/tauri-bundler/src/bundle/dmg_bundle.rs @@ -1,13 +1,14 @@ -use super::common; -use super::osx_bundle; +use super::{common, osx_bundle}; use crate::Settings; use anyhow::Context; -use std::env; -use std::fs::{self, write}; -use std::path::PathBuf; -use std::process::{Command, Stdio}; +use std::{ + env, + fs::{self, write}, + path::PathBuf, + process::{Command, Stdio}, +}; /// Bundles the project. /// Returns a vector of PathBuf that shows where the DMG was created. diff --git a/cli/tauri-bundler/src/bundle/ios_bundle.rs b/cli/tauri-bundler/src/bundle/ios_bundle.rs index 2026ead6e..4f2940189 100644 --- a/cli/tauri-bundler/src/bundle/ios_bundle.rs +++ b/cli/tauri-bundler/src/bundle/ios_bundle.rs @@ -12,14 +12,15 @@ use super::common; use crate::Settings; use anyhow::Context; -use image::png::PngDecoder; -use image::{self, GenericImageView, ImageDecoder}; +use image::{self, png::PngDecoder, GenericImageView, ImageDecoder}; -use std::collections::BTreeSet; -use std::ffi::OsStr; -use std::fs::{self, File}; -use std::io::Write; -use std::path::{Path, PathBuf}; +use std::{ + collections::BTreeSet, + ffi::OsStr, + fs::{self, File}, + io::Write, + path::{Path, PathBuf}, +}; /// Bundles the project. /// Returns a vector of PathBuf that shows where the .app was created. diff --git a/cli/tauri-bundler/src/bundle/msi_bundle.rs b/cli/tauri-bundler/src/bundle/msi_bundle.rs index af734e579..0021490e8 100644 --- a/cli/tauri-bundler/src/bundle/msi_bundle.rs +++ b/cli/tauri-bundler/src/bundle/msi_bundle.rs @@ -1,8 +1,6 @@ -use super::settings::Settings; -use super::wix; +use super::{settings::Settings, wix}; -use std; -use std::path::PathBuf; +use std::{self, path::PathBuf}; /// Runs all of the commands to build the MSI installer. /// Returns a vector of PathBuf that shows where the MSI was created. diff --git a/cli/tauri-bundler/src/bundle/osx_bundle.rs b/cli/tauri-bundler/src/bundle/osx_bundle.rs index 72eda55cf..320fbad78 100644 --- a/cli/tauri-bundler/src/bundle/osx_bundle.rs +++ b/cli/tauri-bundler/src/bundle/osx_bundle.rs @@ -23,13 +23,14 @@ use crate::Settings; use anyhow::Context; use image::{self, GenericImageView}; -use std::cmp::min; -use std::ffi::OsStr; -use std::fs::{self, File}; -use std::io::prelude::*; -use std::io::{self, BufWriter}; -use std::path::{Path, PathBuf}; -use std::process::{Command, Stdio}; +use std::{ + cmp::min, + ffi::OsStr, + fs::{self, File}, + io::{self, prelude::*, BufWriter}, + path::{Path, PathBuf}, + process::{Command, Stdio}, +}; /// Bundles the project. /// Returns a vector of PathBuf that shows where the .app was created. diff --git a/cli/tauri-bundler/src/bundle/path_utils.rs b/cli/tauri-bundler/src/bundle/path_utils.rs index 3082806ee..b34889785 100644 --- a/cli/tauri-bundler/src/bundle/path_utils.rs +++ b/cli/tauri-bundler/src/bundle/path_utils.rs @@ -1,5 +1,7 @@ -use std::fs::{create_dir, create_dir_all, read_dir, remove_dir_all}; -use std::path::{Path, PathBuf}; +use std::{ + fs::{create_dir, create_dir_all, read_dir, remove_dir_all}, + path::{Path, PathBuf}, +}; /// Directory options. #[derive(Clone)] diff --git a/cli/tauri-bundler/src/bundle/settings.rs b/cli/tauri-bundler/src/bundle/settings.rs index 410c18f76..bc297caae 100644 --- a/cli/tauri-bundler/src/bundle/settings.rs +++ b/cli/tauri-bundler/src/bundle/settings.rs @@ -1,14 +1,15 @@ use super::category::AppCategory; -use crate::bundle::common; -use crate::bundle::platform::target_triple; +use crate::bundle::{common, platform::target_triple}; use serde::Deserialize; use target_build_utils::TargetInfo; -use std::collections::HashMap; -use std::fs::File; -use std::io::Read; -use std::path::{Path, PathBuf}; +use std::{ + collections::HashMap, + fs::File, + io::Read, + path::{Path, PathBuf}, +}; /// The type of the package we're bundling. #[derive(Clone, Copy, Debug, Eq, PartialEq)] diff --git a/cli/tauri-bundler/src/bundle/wix.rs b/cli/tauri-bundler/src/bundle/wix.rs index 44f314a99..3c88c6018 100644 --- a/cli/tauri-bundler/src/bundle/wix.rs +++ b/cli/tauri-bundler/src/bundle/wix.rs @@ -1,6 +1,8 @@ -use super::common; -use super::path_utils::{copy, Options}; -use super::settings::Settings; +use super::{ + common, + path_utils::{copy, Options}, + settings::Settings, +}; use handlebars::{to_json, Handlebars}; use lazy_static::lazy_static; @@ -10,11 +12,13 @@ use sha2::Digest; use uuid::Uuid; use zip::ZipArchive; -use std::collections::BTreeMap; -use std::fs::{create_dir_all, remove_dir_all, write, File}; -use std::io::{Cursor, Read, Write}; -use std::path::{Path, PathBuf}; -use std::process::{Command, Stdio}; +use std::{ + collections::BTreeMap, + fs::{create_dir_all, remove_dir_all, write, File}, + io::{Cursor, Read, Write}, + path::{Path, PathBuf}, + process::{Command, Stdio}, +}; // URLS for the WIX toolchain. Can be used for crossplatform compilation. pub const WIX_URL: &str = diff --git a/cli/tauri.js/templates/src-tauri/rustfmt.toml b/cli/tauri.js/templates/src-tauri/rustfmt.toml index 45642c190..136f5f330 100644 --- a/cli/tauri.js/templates/src-tauri/rustfmt.toml +++ b/cli/tauri.js/templates/src-tauri/rustfmt.toml @@ -11,3 +11,4 @@ merge_derives = true use_try_shorthand = false use_field_init_shorthand = false force_explicit_abi = true +imports_granularity = "Crate" diff --git a/cli/tauri.js/test/jest/fixtures/app/src-tauri/rustfmt.toml b/cli/tauri.js/test/jest/fixtures/app/src-tauri/rustfmt.toml index 45642c190..136f5f330 100644 --- a/cli/tauri.js/test/jest/fixtures/app/src-tauri/rustfmt.toml +++ b/cli/tauri.js/test/jest/fixtures/app/src-tauri/rustfmt.toml @@ -11,3 +11,4 @@ merge_derives = true use_try_shorthand = false use_field_init_shorthand = false force_explicit_abi = true +imports_granularity = "Crate" diff --git a/rustfmt.toml b/rustfmt.toml index 44fe5d066..a37d2e4cc 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -11,3 +11,4 @@ merge_derives = true use_try_shorthand = false use_field_init_shorthand = false force_explicit_abi = true +imports_granularity = "Crate" diff --git a/tauri-api/src/dir.rs b/tauri-api/src/dir.rs index 8d5bd43dd..d3da0d072 100644 --- a/tauri-api/src/dir.rs +++ b/tauri-api/src/dir.rs @@ -1,6 +1,8 @@ use serde::Serialize; -use std::fs::{self, metadata}; -use std::path::{Path, PathBuf}; +use std::{ + fs::{self, metadata}, + path::{Path, PathBuf}, +}; use tempfile::{self, tempdir}; /// The result of the `read_dir` function. @@ -64,8 +66,7 @@ pub fn with_temp_dir(callback: F) -> crate::Resul mod test { use super::*; use quickcheck_macros::quickcheck; - use std::ffi::OsStr; - use std::path::PathBuf; + use std::{ffi::OsStr, path::PathBuf}; // check is dir function by passing in arbitrary strings #[quickcheck] diff --git a/tauri-api/src/file.rs b/tauri-api/src/file.rs index 524c1535f..218f0dfab 100644 --- a/tauri-api/src/file.rs +++ b/tauri-api/src/file.rs @@ -1,8 +1,7 @@ mod extract; mod file_move; -use std::fs; -use std::path::Path; +use std::{fs, path::Path}; pub use extract::*; pub use file_move::*; diff --git a/tauri-api/src/file/extract.rs b/tauri-api/src/file/extract.rs index 1bc8f54cf..4ad67a3c8 100644 --- a/tauri-api/src/file/extract.rs +++ b/tauri-api/src/file/extract.rs @@ -1,8 +1,6 @@ use either::{self, Either}; -use std::fs; -use std::io; -use std::path; +use std::{fs, io, path}; /// The supported archive formats. #[derive(Debug, Clone, Copy, PartialEq)] diff --git a/tauri-api/src/file/file_move.rs b/tauri-api/src/file/file_move.rs index 9ef872b45..71c6f1eea 100644 --- a/tauri-api/src/file/file_move.rs +++ b/tauri-api/src/file/file_move.rs @@ -1,5 +1,4 @@ -use std::fs; -use std::path; +use std::{fs, path}; /// Moves a file from the given path to the specified destination. /// diff --git a/tauri-api/src/http.rs b/tauri-api/src/http.rs index 2e61afbb7..8978420ce 100644 --- a/tauri-api/src/http.rs +++ b/tauri-api/src/http.rs @@ -3,9 +3,7 @@ use http::header::HeaderName; use serde::Deserialize; use serde_json::Value; use serde_repr::{Deserialize_repr, Serialize_repr}; -use std::collections::HashMap; -use std::fs::File; -use std::time::Duration; +use std::{collections::HashMap, fs::File, time::Duration}; #[derive(Serialize_repr, Deserialize_repr, Clone, Debug)] #[repr(u16)] diff --git a/tauri-macros/src/error.rs b/tauri-macros/src/error.rs index 5f5e48e19..827ed85ae 100644 --- a/tauri-macros/src/error.rs +++ b/tauri-macros/src/error.rs @@ -1,7 +1,6 @@ use proc_macro2::{Ident, TokenStream}; use quote::quote; -use std::io::Error as IoError; -use std::path::PathBuf; +use std::{io::Error as IoError, path::PathBuf}; use Error::*; pub(crate) enum Error { diff --git a/tauri-macros/src/expand.rs b/tauri-macros/src/expand.rs index db250b535..31281e39d 100644 --- a/tauri-macros/src/expand.rs +++ b/tauri-macros/src/expand.rs @@ -1,13 +1,13 @@ -use crate::error::Error; -use crate::include_dir::IncludeDir; -use crate::DEFAULT_CONFIG_FILE; +use crate::{error::Error, include_dir::IncludeDir, DEFAULT_CONFIG_FILE}; use proc_macro2::TokenStream; use quote::quote; -use std::collections::HashSet; -use std::env::var; -use std::fs::File; -use std::io::BufReader; -use std::path::{Path, PathBuf}; +use std::{ + collections::HashSet, + env::var, + fs::File, + io::BufReader, + path::{Path, PathBuf}, +}; use syn::{DeriveInput, Lit::Str, Meta::NameValue, MetaNameValue}; use tauri_utils::{assets::AssetCompression, config::Config}; diff --git a/tauri-macros/src/include_dir.rs b/tauri-macros/src/include_dir.rs index 762977575..cd7a66929 100644 --- a/tauri-macros/src/include_dir.rs +++ b/tauri-macros/src/include_dir.rs @@ -1,13 +1,14 @@ use crate::error::Error; use flate2::bufread::GzEncoder; use proc_macro2::TokenStream; -use quote::quote; -use quote::TokenStreamExt; -use std::collections::{HashMap, HashSet}; -use std::env::var; -use std::fs::{canonicalize, create_dir_all, File}; -use std::io::{BufReader, BufWriter}; -use std::path::{Path, PathBuf}; +use quote::{quote, TokenStreamExt}; +use std::{ + collections::{HashMap, HashSet}, + env::var, + fs::{canonicalize, create_dir_all, File}, + io::{BufReader, BufWriter}, + path::{Path, PathBuf}, +}; use tauri_utils::assets::{AssetCompression, Assets}; use walkdir::WalkDir; diff --git a/tauri-utils/src/assets.rs b/tauri-utils/src/assets.rs index 483aced4f..3b6daad27 100644 --- a/tauri-utils/src/assets.rs +++ b/tauri-utils/src/assets.rs @@ -2,8 +2,10 @@ use flate2::read::{GzDecoder, GzEncoder}; pub use phf; -use std::io::Read; -use std::path::{Component, Path, PathBuf}; +use std::{ + io::Read, + path::{Component, Path, PathBuf}, +}; /// Type of compression applied to an asset #[derive(Debug, Copy, Clone, PartialEq, Eq)] diff --git a/tauri-utils/src/config.rs b/tauri-utils/src/config.rs index 41ea9cf1c..325f3c5d4 100644 --- a/tauri-utils/src/config.rs +++ b/tauri-utils/src/config.rs @@ -1,5 +1,7 @@ -use serde::de::{Deserializer, Error as DeError, Visitor}; -use serde::Deserialize; +use serde::{ + de::{Deserializer, Error as DeError, Visitor}, + Deserialize, +}; use serde_json::Value as JsonValue; use std::collections::HashMap; diff --git a/tauri/examples/api/src-tauri/rustfmt.toml b/tauri/examples/api/src-tauri/rustfmt.toml index 45642c190..136f5f330 100644 --- a/tauri/examples/api/src-tauri/rustfmt.toml +++ b/tauri/examples/api/src-tauri/rustfmt.toml @@ -11,3 +11,4 @@ merge_derives = true use_try_shorthand = false use_field_init_shorthand = false force_explicit_abi = true +imports_granularity = "Crate" diff --git a/tauri/examples/communication/src-tauri/rustfmt.toml b/tauri/examples/communication/src-tauri/rustfmt.toml index 45642c190..136f5f330 100644 --- a/tauri/examples/communication/src-tauri/rustfmt.toml +++ b/tauri/examples/communication/src-tauri/rustfmt.toml @@ -11,3 +11,4 @@ merge_derives = true use_try_shorthand = false use_field_init_shorthand = false force_explicit_abi = true +imports_granularity = "Crate" diff --git a/tauri/src/app.rs b/tauri/src/app.rs index 276bc7e2c..bea2a934c 100644 --- a/tauri/src/app.rs +++ b/tauri/src/app.rs @@ -1,8 +1,7 @@ use crate::ApplicationExt; use futures::future::BoxFuture; use std::marker::PhantomData; -use tauri_api::config::Config; -use tauri_api::private::AsTauriContext; +use tauri_api::{config::Config, private::AsTauriContext}; mod runner; diff --git a/tauri/src/app/runner.rs b/tauri/src/app/runner.rs index cc15ac963..b637bd7a0 100644 --- a/tauri/src/app/runner.rs +++ b/tauri/src/app/runner.rs @@ -394,8 +394,7 @@ fn get_api_error_message(arg: &str, handler_error_message: String) -> String { #[cfg(test)] mod test { use super::Content; - use crate::Context; - use crate::FromTauriContext; + use crate::{Context, FromTauriContext}; use proptest::prelude::*; #[cfg(dev)] use std::io::Read; diff --git a/tauri/src/endpoints/dialog.rs b/tauri/src/endpoints/dialog.rs index 1ec00cf13..edeb25ac7 100644 --- a/tauri/src/endpoints/dialog.rs +++ b/tauri/src/endpoints/dialog.rs @@ -1,9 +1,11 @@ use super::cmd::{OpenDialogOptions, SaveDialogOptions}; -use crate::api::dialog::{ - ask as ask_dialog, message as message_dialog, pick_folder, save_file, select, select_multiple, - DialogSelection, Response, +use crate::{ + api::dialog::{ + ask as ask_dialog, message as message_dialog, pick_folder, save_file, select, select_multiple, + DialogSelection, Response, + }, + ApplicationDispatcherExt, }; -use crate::ApplicationDispatcherExt; use serde_json::Value as JsonValue; /// maps a dialog response to a JS value to eval diff --git a/tauri/src/endpoints/file_system.rs b/tauri/src/endpoints/file_system.rs index 0ebff3fd0..c48b9356e 100644 --- a/tauri/src/endpoints/file_system.rs +++ b/tauri/src/endpoints/file_system.rs @@ -1,13 +1,8 @@ use crate::ApplicationDispatcherExt; -use tauri_api::dir; -use tauri_api::file; -use tauri_api::path::resolve_path; +use tauri_api::{dir, file, path::resolve_path}; -use std::fs; -use std::fs::File; -use std::io::Write; -use std::path::PathBuf; +use std::{fs, fs::File, io::Write, path::PathBuf}; use super::cmd::{DirOperationOptions, FileOperationOptions}; diff --git a/tauri/src/endpoints/notification.rs b/tauri/src/endpoints/notification.rs index 72be0f90c..d51462de8 100644 --- a/tauri/src/endpoints/notification.rs +++ b/tauri/src/endpoints/notification.rs @@ -1,8 +1,7 @@ use super::cmd::NotificationOptions; use crate::ApplicationDispatcherExt; use serde_json::Value as JsonValue; -use tauri_api::config::Config; -use tauri_api::notification::Notification; +use tauri_api::{config::Config, notification::Notification}; pub async fn send( dispatcher: &mut D, diff --git a/tauri/src/endpoints/path.rs b/tauri/src/endpoints/path.rs index eea5543fb..424718106 100644 --- a/tauri/src/endpoints/path.rs +++ b/tauri/src/endpoints/path.rs @@ -1,7 +1,6 @@ #![cfg(path_api)] use crate::ApplicationDispatcherExt; -use tauri_api::path; -use tauri_api::path::BaseDirectory; +use tauri_api::{path, path::BaseDirectory}; pub async fn resolve_path( dispatcher: &mut D, diff --git a/tauri/src/event.rs b/tauri/src/event.rs index dd86b86ab..4abdbd8f7 100644 --- a/tauri/src/event.rs +++ b/tauri/src/event.rs @@ -1,6 +1,8 @@ -use std::boxed::Box; -use std::collections::HashMap; -use std::sync::{Arc, Mutex}; +use std::{ + boxed::Box, + collections::HashMap, + sync::{Arc, Mutex}, +}; use crate::ApplicationDispatcherExt; use lazy_static::lazy_static; diff --git a/tauri/src/plugin.rs b/tauri/src/plugin.rs index e1ab188f8..98a3f02be 100644 --- a/tauri/src/plugin.rs +++ b/tauri/src/plugin.rs @@ -1,6 +1,4 @@ -use crate::api::config::PluginConfig; -use crate::async_runtime::Mutex; -use crate::ApplicationDispatcherExt; +use crate::{api::config::PluginConfig, async_runtime::Mutex, ApplicationDispatcherExt}; use futures::future::join_all; diff --git a/tauri/src/settings.rs b/tauri/src/settings.rs index 45ce18755..18fd7b827 100644 --- a/tauri/src/settings.rs +++ b/tauri/src/settings.rs @@ -1,9 +1,13 @@ use serde::{Deserialize, Serialize}; -use std::fs::File; -use std::io::Write; -use std::path::{Path, PathBuf}; -use tauri_api::file::read_string; -use tauri_api::path::{resolve_path, BaseDirectory}; +use std::{ + fs::File, + io::Write, + path::{Path, PathBuf}, +}; +use tauri_api::{ + file::read_string, + path::{resolve_path, BaseDirectory}, +}; /// Tauri Settings. #[derive(Default, Deserialize, Serialize)]