Skip to content

Commit

Permalink
update rustfmt.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
figsoda committed Jul 1, 2023
1 parent dc95ad0 commit ae3b2dd
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use clap::CommandFactory;
use clap_complete::{generate_to, Shell};
use clap_mangen::Man;

use std::{
env,
fs::{create_dir_all, File},
path::Path,
};

use clap::CommandFactory;
use clap_complete::{generate_to, Shell};
use clap_mangen::Man;

include!("src/cli.rs");

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ unstable_features = true

condense_wildcard_suffixes = true
format_code_in_doc_comments = true
group_imports = "StdExternalCrate"
imports_granularity = "Crate"
newline_style = "Unix"
normalize_comments = true
normalize_doc_attributes = true
overflow_delimited_expr = false
reorder_impl_items = true
spaces_around_ranges = true
use_field_init_shorthand = true
Expand Down
4 changes: 2 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use clap::{Parser, ValueEnum};

use std::path::PathBuf;

use clap::{Parser, ValueEnum};

/// Mod packager for Factorio
///
/// Homepage: https://github.com/figsoda/pactorio
Expand Down
16 changes: 8 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ mod release;
mod types;
mod upload;

use crate::{
cli::Opts,
types::{Config, Info},
use std::{
env::set_current_dir,
fs::{self, File},
io::Cursor,
path::Path,
};

use anyhow::{Context, Result};
Expand All @@ -18,11 +20,9 @@ use rpassword::prompt_password;
use serde::Serialize;
use walkdir::WalkDir;

use std::{
env::set_current_dir,
fs::{self, File},
io::Cursor,
path::Path,
use crate::{
cli::Opts,
types::{Config, Info},
};

fn main() -> Result<()> {
Expand Down
12 changes: 6 additions & 6 deletions src/release.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use anyhow::{anyhow, Context, Result};
use is_executable::IsExecutable;
use zip::{write::FileOptions, CompressionMethod, ZipWriter};

use crate::fail;

use std::{
fs::{self, File},
io::{self, Seek, Write},
path::{Path, PathBuf},
};

use anyhow::{anyhow, Context, Result};
use is_executable::IsExecutable;
use zip::{write::FileOptions, CompressionMethod, ZipWriter};

use crate::fail;

pub fn remove_path(path: &Path) -> Result<()> {
if path.is_dir() {
fs::remove_dir_all(path).with_context(fail::remove_dir(path.display()))?;
Expand Down
4 changes: 2 additions & 2 deletions src/types.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::{collections::HashMap, default::Default};

use serde::{Deserialize, Serialize};
use thiserror::Error;

use std::{collections::HashMap, default::Default};

#[derive(Clone, Serialize, Deserialize)]
pub struct Deps {
#[serde(default)]
Expand Down
4 changes: 2 additions & 2 deletions src/upload.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::types::{FinishUploadResult, InitUploadResult};
use std::{error::Error, fmt::Write};

use anyhow::{anyhow, bail, Result};
use multipart::client::lazy::Multipart;
use ureq::Transport;

use std::{error::Error, fmt::Write};
use crate::types::{FinishUploadResult, InitUploadResult};

fn transport_error(api_name: &str, e: Transport) -> Result<()> {
let mut msg = format!("{api_name}: {}", e.kind());
Expand Down

0 comments on commit ae3b2dd

Please sign in to comment.