Skip to content

Commit a1429ac

Browse files
committed
Fixes some clippy- and docs-warnings
1 parent acf1b4b commit a1429ac

4 files changed

Lines changed: 14 additions & 17 deletions

File tree

src/license.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ impl Detector {
139139
&& entry
140140
.file_name()
141141
.map(OsStr::to_string_lossy)
142-
.map(is_license_file)
143-
.unwrap_or_default()
142+
.is_some_and(is_license_file)
144143
})
145144
.filter_map(|entry| {
146145
let contents = fs::read_to_string(entry.as_path()).unwrap_or_default(); // TODO Not too clean; we should possibly fail the function instead of silently skipping the file on error

src/settings.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use clap::ValueEnum;
66
use lazy_static::lazy_static;
77
use std::{collections::HashSet, path::PathBuf};
88
use strum::IntoEnumIterator;
9-
use strum_macros::{EnumIter, EnumString, EnumVariantNames, IntoStaticStr};
9+
use strum_macros::{EnumIter, EnumString, IntoStaticStr, VariantNames};
1010
use url::Url;
1111

1212
use crate::{
@@ -19,7 +19,7 @@ use crate::{
1919
Debug,
2020
ValueEnum,
2121
EnumString,
22-
EnumVariantNames,
22+
VariantNames,
2323
EnumIter,
2424
IntoStaticStr,
2525
PartialEq,
@@ -79,7 +79,7 @@ impl From<bool> for Verbosity {
7979
}
8080
}
8181

82-
#[derive(Debug, ValueEnum, EnumString, EnumVariantNames, IntoStaticStr, Clone, Copy)]
82+
#[derive(Debug, ValueEnum, EnumString, VariantNames, IntoStaticStr, Clone, Copy)]
8383
pub enum Overwrite {
8484
All,
8585
None,

src/tools/git.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub enum TransferProtocol {
5757
/// Example:
5858
/// `"https://gitlab.com/hoijui/kicad-text-injector.git"`
5959
Https,
60-
/// SSH - Secure SHell
60+
/// SSH - **S**ecure **Sh**ell
6161
/// Documentation:
6262
/// <https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols#_the_ssh_protocol>
6363
/// Example:

src/tools/git_hosting_provs.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,30 @@ use clap::ValueEnum;
77
/// both the actual hosters (github.com, gitlab.com, bitbucket.org, ...),
88
/// as well as the software (gitlab, gitea, ...).
99
use std::str;
10-
use strum_macros::{EnumString, EnumVariantNames, IntoStaticStr};
10+
use strum_macros::{EnumString, IntoStaticStr, VariantNames};
1111
use url::Host;
1212

1313
use crate::constants;
1414

1515
use super::git::TransferProtocol;
1616

17-
#[derive(Debug, EnumString, EnumVariantNames, IntoStaticStr, PartialEq, Eq, Clone, Copy)]
17+
#[derive(Debug, EnumString, VariantNames, IntoStaticStr, PartialEq, Eq, Clone, Copy)]
1818
pub enum PublicSite {
1919
/// <https://github.com> - commercial, free OS hosting, software is proprietary
2020
GitHubCom,
2121
/// <https://gitlab.com> - commercial, free OS hosting, software is OSS
2222
GitLabCom,
2323
/// <https://bitbucket.org> - commercial, free OS hosting, software is proprietary
2424
BitBucketOrg,
25-
/// <https://git.sr.ht> - free OS hosting, software is OSS: SourceHut
25+
/// <https://git.sr.ht> - free OS hosting, software is OSS: `SourceHut`
2626
SourceHut,
27-
/// <https://codeberg.org> - hosts only OS, software is OSS: Gitea
27+
/// <https://codeberg.org> - hosts only OS, software is OSS: `Gitea`
2828
CodeBergOrg,
29-
/// <https://repo.or.cz> - hosts only OS, software is OSS: Girocco
29+
/// <https://repo.or.cz> - hosts only OS, software is OSS: `Girocco`
3030
RepoOrCz,
31-
/// <https://sourceforge.net> - hosts only OS, software is OSS: Allura
31+
/// <https://sourceforge.net> - hosts only OS, software is OSS: `Allura`
3232
RocketGitCom,
33-
/// <https://rocketgit.com> - hosts only OS, software is OSS: RocketGit
33+
/// <https://rocketgit.com> - hosts only OS, software is OSS: `RocketGit`
3434
SourceForgeNet,
3535
/// NOTE: The rust masters said, this is better then `Option<None>`!
3636
Unknown,
@@ -100,17 +100,15 @@ impl From<Option<Host<&str>>> for PublicSite {
100100
}
101101
}
102102

103-
#[derive(
104-
Debug, ValueEnum, EnumString, EnumVariantNames, IntoStaticStr, PartialEq, Eq, Clone, Copy,
105-
)]
103+
#[derive(Debug, ValueEnum, EnumString, VariantNames, IntoStaticStr, PartialEq, Eq, Clone, Copy)]
106104
pub enum HostingType {
107105
/// <https://github.com> - proprietary
108106
GitHub,
109107
/// <https://about.gitlab.com> - OSS
110108
GitLab,
111109
/// <https://bitbucket.org> - proprietary
112110
BitBucket,
113-
/// <https://sr.ht/~sircmpwn/sourcehut> - OSS - LowTech (no JS) hacker tool, (almost) suckless style
111+
/// <https://sr.ht/~sircmpwn/sourcehut> - OSS - Low-tech (no JS) hacker tool, (almost) suckless style
114112
SourceHut,
115113
/// <https://gitea.io> - OSS
116114
Gitea,

0 commit comments

Comments
 (0)