Parcourir la source

chore(fmt): merge imports (#1216)

Lucas Fernandes Nogueira il y a 4 ans
Parent
commit
35468f68e5
44 fichiers modifiés avec 191 ajouts et 164 suppressions
  1. 8 6
      cli/core/build.rs
  2. 7 5
      cli/core/src/build.rs
  3. 13 9
      cli/core/src/dev.rs
  4. 1 2
      cli/core/src/helpers/app_paths.rs
  5. 11 7
      cli/core/src/helpers/config.rs
  6. 4 2
      cli/core/src/helpers/manifest.rs
  7. 4 2
      cli/core/src/helpers/mod.rs
  8. 1 2
      cli/core/src/init.rs
  9. 1 0
      cli/tauri-bundler/rustfmt.toml
  10. 4 3
      cli/tauri-bundler/src/bundle.rs
  11. 7 7
      cli/tauri-bundler/src/bundle/appimage_bundle.rs
  12. 8 7
      cli/tauri-bundler/src/bundle/common.rs
  13. 8 7
      cli/tauri-bundler/src/bundle/deb_bundle.rs
  14. 7 6
      cli/tauri-bundler/src/bundle/dmg_bundle.rs
  15. 8 7
      cli/tauri-bundler/src/bundle/ios_bundle.rs
  16. 2 4
      cli/tauri-bundler/src/bundle/msi_bundle.rs
  17. 8 7
      cli/tauri-bundler/src/bundle/osx_bundle.rs
  18. 4 2
      cli/tauri-bundler/src/bundle/path_utils.rs
  19. 7 6
      cli/tauri-bundler/src/bundle/settings.rs
  20. 12 8
      cli/tauri-bundler/src/bundle/wix.rs
  21. 1 0
      cli/tauri.js/templates/src-tauri/rustfmt.toml
  22. 1 0
      cli/tauri.js/test/jest/fixtures/app/src-tauri/rustfmt.toml
  23. 1 0
      rustfmt.toml
  24. 5 4
      tauri-api/src/dir.rs
  25. 1 2
      tauri-api/src/file.rs
  26. 1 3
      tauri-api/src/file/extract.rs
  27. 1 2
      tauri-api/src/file/file_move.rs
  28. 1 3
      tauri-api/src/http.rs
  29. 1 2
      tauri-macros/src/error.rs
  30. 8 8
      tauri-macros/src/expand.rs
  31. 8 7
      tauri-macros/src/include_dir.rs
  32. 4 2
      tauri-utils/src/assets.rs
  33. 4 2
      tauri-utils/src/config.rs
  34. 1 0
      tauri/examples/api/src-tauri/rustfmt.toml
  35. 1 0
      tauri/examples/communication/src-tauri/rustfmt.toml
  36. 1 2
      tauri/src/app.rs
  37. 1 2
      tauri/src/app/runner.rs
  38. 6 4
      tauri/src/endpoints/dialog.rs
  39. 2 7
      tauri/src/endpoints/file_system.rs
  40. 1 2
      tauri/src/endpoints/notification.rs
  41. 1 2
      tauri/src/endpoints/path.rs
  42. 5 3
      tauri/src/event.rs
  43. 1 3
      tauri/src/plugin.rs
  44. 9 5
      tauri/src/settings.rs

+ 8 - 6
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<dyn Error>> {
   let out_dir = env::var("OUT_DIR")?;

+ 7 - 5
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 {

+ 13 - 9
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 {

+ 1 - 2
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;
 

+ 11 - 7
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<Mutex<Option<Config>>>;
 

+ 4 - 2
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");

+ 4 - 2
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

+ 1 - 2
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,

+ 1 - 0
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"

+ 4 - 3
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;

+ 7 - 7
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! {

+ 8 - 7
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() {

+ 8 - 7
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.

+ 7 - 6
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.

+ 8 - 7
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.

+ 2 - 4
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.

+ 8 - 7
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.

+ 4 - 2
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)]

+ 7 - 6
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)]

+ 12 - 8
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 =

+ 1 - 0
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"

+ 1 - 0
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"

+ 1 - 0
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"

+ 5 - 4
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<F: FnOnce(&tempfile::TempDir)>(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]

+ 1 - 2
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::*;

+ 1 - 3
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)]

+ 1 - 2
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.
 ///

+ 1 - 3
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)]

+ 1 - 2
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 {

+ 8 - 8
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};
 

+ 8 - 7
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;
 

+ 4 - 2
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)]

+ 4 - 2
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;

+ 1 - 0
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"

+ 1 - 0
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"

+ 1 - 2
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;
 

+ 1 - 2
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;

+ 6 - 4
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

+ 2 - 7
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};
 

+ 1 - 2
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<D: ApplicationDispatcherExt>(
   dispatcher: &mut D,

+ 1 - 2
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<D: ApplicationDispatcherExt>(
   dispatcher: &mut D,

+ 5 - 3
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;

+ 1 - 3
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;
 

+ 9 - 5
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)]