Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Serial-ATA committed Jul 23, 2024
1 parent 8f049f0 commit 729571c
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 62 deletions.
52 changes: 0 additions & 52 deletions .cargo/config

This file was deleted.

45 changes: 44 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,47 @@ reqwest = { version = "0.12.5", features = ["blocking"] }
serde = { version = "1.0.145", features = ["derive"] }
thiserror = "1.0.37"
toml = "0.8.15"
dirs = "5.0.1"
dirs = "5.0.1"

[lints.rust]
rust_2018_idioms = { level = "deny", priority = -1 }
trivial_casts = "deny"
trivial_numeric_casts = "deny"
unused_import_braces = "deny"
explicit_outlives_requirements = "deny"
unknown_lints = "allow"

[lints.clippy]
pedantic = { level = "deny", priority = -1 }
all = { level = "deny", priority = -1 }
too_many_lines = "allow"
cast_precision_loss = "allow"
cast_sign_loss = "allow"
cast_possible_wrap = "allow"
cast_possible_truncation = "allow"
module_name_repetitions = "allow"
must_use_candidate = "allow"
doc_markdown = "allow"
match_wildcard_for_single_variants = "allow"
semicolon_if_nothing_returned = "allow"
from_over_into = "allow"
upper_case_acronyms = "allow"
single_match_else = "allow"
similar_names = "allow"
tabs_in_doc_comments = "allow"
len_without_is_empty = "allow"
needless_late_init = "allow"
type_complexity = "allow"
return_self_not_must_use = "allow"
bool_to_int_with_if = "allow"
uninlined_format_args = "allow" # This should be changed for any normal "{}", but I'm not a fan of it for any debug or width specific formatting
let_underscore_untyped = "allow"
field_reassign_with_default = "allow"
manual_range_patterns = "allow" # This is not at all clearer as it suggests
no_effect_underscore_binding = "allow"
used_underscore_binding = "allow"
ignored_unit_patterns = "allow" # Not a fan of this lint, doesn't make anything clearer as it claims
needless_return = "allow" # Explicit returns are needed from time to time for clarity
redundant_guards = "allow" # Currently broken for some cases, might enable later
into_iter_without_iter = "allow" # This is only going to fire on some internal types, doesn't matter much
struct_excessive_bools = "allow" # I have yet to find one case of this being useful
15 changes: 6 additions & 9 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ impl Default for Config {

impl Config {
pub fn read() -> Result<Self> {
let config_dir = match dirs::config_dir() {
Some(dir) => dir,
None => {
log::warn!(
"Failed to find config dir, using default config. Consider setting \
`XDG_CONFIG_HOME`."
);
return Ok(Self::default());
},
let Some(config_dir) = dirs::config_dir() else {
log::warn!(
"Failed to find config dir, using default config. Consider setting \
`XDG_CONFIG_HOME`."
);
return Ok(Self::default());
};

let config_dir = config_dir.join("lyr");
Expand Down

0 comments on commit 729571c

Please sign in to comment.