Skip to content

Commit f8ce3d0

Browse files
committed
fix lints for nightly, and clippy
1 parent 61c002b commit f8ce3d0

File tree

342 files changed

+606
-290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

342 files changed

+606
-290
lines changed

Diff for: .github/workflows/ci.yml

+17-17
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ jobs:
4747
test:
4848
runs-on: ubuntu-latest
4949
steps:
50-
- uses: actions/checkout@v3
51-
- uses: dtolnay/rust-toolchain@stable
52-
- uses: Swatinem/rust-cache@v2
53-
- name: Setup dependencies
54-
run:
55-
sudo apt-get install tree
56-
- uses: extractions/setup-just@v1
57-
- name: test
58-
env:
59-
CI: true
60-
GITOXIDE_TEST_IGNORE_ARCHIVES: 1
61-
run: just ci-test
50+
- uses: actions/checkout@v3
51+
- uses: dtolnay/rust-toolchain@stable
52+
- uses: Swatinem/rust-cache@v2
53+
- name: Setup dependencies
54+
run:
55+
sudo apt-get install tree
56+
- uses: extractions/setup-just@v1
57+
- name: test
58+
env:
59+
CI: true
60+
GITOXIDE_TEST_IGNORE_ARCHIVES: 1
61+
run: just ci-test
6262

6363
test-fast:
6464
strategy:
@@ -163,7 +163,7 @@ jobs:
163163
components: clippy,rustfmt
164164
- uses: extractions/setup-just@v1
165165
- name: Run cargo clippy
166-
run: just clippy -D warnings
166+
run: just clippy -D warnings -A unknown-lints
167167
- name: Run cargo doc
168168
run: just doc
169169
- name: Run cargo fmt
@@ -189,10 +189,10 @@ jobs:
189189
continue-on-error: ${{ matrix.checks == 'advisories' }}
190190

191191
steps:
192-
- uses: actions/checkout@v3
193-
- uses: EmbarkStudios/cargo-deny-action@v1
194-
with:
195-
command: check ${{ matrix.checks }}
192+
- uses: actions/checkout@v3
193+
- uses: EmbarkStudios/cargo-deny-action@v1
194+
with:
195+
command: check ${{ matrix.checks }}
196196
wasm:
197197
name: WebAssembly
198198
runs-on: ubuntu-latest

Diff for: gitoxide-core/src/repository/credential.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::convert::TryInto;
2-
31
#[derive(Debug, thiserror::Error)]
42
enum Error {
53
#[error(transparent)]

Diff for: gix-actor/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use gix_date::Time;
2222

2323
mod identity;
2424
///
25+
#[allow(clippy::empty_docs)]
2526
pub mod signature;
2627

2728
/// A person with name and email.

Diff for: gix-actor/src/signature/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,6 @@ pub(crate) mod write {
129129
}
130130

131131
///
132+
#[allow(clippy::empty_docs)]
132133
pub mod decode;
133134
pub use decode::function::decode;

Diff for: gix-attributes/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@ use kstring::{KString, KStringRef};
1313

1414
mod assignment;
1515
///
16+
#[allow(clippy::empty_docs)]
1617
pub mod name;
1718
///
19+
#[allow(clippy::empty_docs)]
1820
pub mod state;
1921

2022
///
23+
#[allow(clippy::empty_docs)]
2124
pub mod search;
2225

2326
///
27+
#[allow(clippy::empty_docs)]
2428
pub mod parse;
2529

2630
/// Parse attribute assignments line by line from `bytes`, and fail the operation on error.

Diff for: gix-attributes/src/search/outcome.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl Outcome {
2626
for (order, macro_attributes) in collection.iter().filter_map(|(_, meta)| {
2727
(!meta.macro_attributes.is_empty()).then_some((meta.id.0, &meta.macro_attributes))
2828
}) {
29-
self.matches_by_id[order].macro_attributes = macro_attributes.clone()
29+
self.matches_by_id[order].macro_attributes.clone_from(macro_attributes)
3030
}
3131

3232
for (name, id) in self.selected.iter_mut().filter(|(_, id)| id.is_none()) {
@@ -88,7 +88,7 @@ impl Outcome {
8888
/// Note that it's safe to call it multiple times, so that it can be called after this instance was used to store a search result.
8989
pub fn copy_into(&self, collection: &MetadataCollection, dest: &mut Self) {
9090
dest.initialize(collection);
91-
dest.matches_by_id = self.matches_by_id.clone();
91+
dest.matches_by_id.clone_from(&self.matches_by_id);
9292
if dest.patterns.len() != self.patterns.len() {
9393
dest.patterns = self.patterns.clone();
9494
}
@@ -325,7 +325,11 @@ impl MetadataCollection {
325325
};
326326

327327
self.assign_order_to_attributes(attrs);
328-
self.name_to_meta.get_mut(name).expect("just added").macro_attributes = attrs.clone();
328+
self.name_to_meta
329+
.get_mut(name)
330+
.expect("just added")
331+
.macro_attributes
332+
.clone_from(attrs);
329333

330334
order
331335
}

Diff for: gix-bitmap/src/ewah.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
use std::convert::TryInto;
2-
31
///
2+
#[allow(clippy::empty_docs)]
43
pub mod decode {
54
/// The error returned by [`decode()`][super::decode()].
65
#[derive(Debug, thiserror::Error)]
@@ -52,8 +51,6 @@ pub fn decode(data: &[u8]) -> Result<(Vec, &[u8]), decode::Error> {
5251
}
5352

5453
mod access {
55-
use std::convert::{TryFrom, TryInto};
56-
5754
use super::Vec;
5855

5956
impl Vec {

Diff for: gix-bitmap/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
pub mod ewah;
88

99
pub(crate) mod decode {
10-
use std::convert::TryInto;
11-
1210
#[inline]
1311
pub(crate) fn split_at_pos(data: &[u8], pos: usize) -> Option<(&[u8], &[u8])> {
1412
if data.len() < pos {

Diff for: gix-chunk/src/file/decode.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{convert::TryInto, ops::Range};
1+
use std::ops::Range;
22

33
mod error {
44
/// The value returned by [`crate::file::Index::from_bytes()`]

Diff for: gix-chunk/src/file/index.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::ops::Range;
33
use crate::file::Index;
44

55
///
6+
#[allow(clippy::empty_docs)]
67
pub mod offset_by_kind {
78
use std::fmt::{Display, Formatter};
89

@@ -27,6 +28,7 @@ pub mod offset_by_kind {
2728
}
2829

2930
///
31+
#[allow(clippy::empty_docs)]
3032
pub mod data_by_kind {
3133
/// The error returned by [`Index::data_by_id()`][super::Index::data_by_id()].
3234
#[derive(Debug, thiserror::Error)]

Diff for: gix-chunk/src/file/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
///
2+
#[allow(clippy::empty_docs)]
23
pub mod decode;
34
///
5+
#[allow(clippy::empty_docs)]
46
pub mod index;
57

68
///
9+
#[allow(clippy::empty_docs)]
710
pub mod write;
811

912
/// The offset to a chunk as seen relative to the beginning of the file containing it.

Diff for: gix-chunk/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ pub type Id = [u8; 4];
1010
pub const SENTINEL: Id = [0u8; 4];
1111

1212
///
13+
#[allow(clippy::empty_docs)]
1314
pub mod range {
14-
use std::{convert::TryInto, ops::Range};
15+
use std::ops::Range;
1516

1617
use crate::file;
1718

@@ -33,4 +34,5 @@ pub mod range {
3334
}
3435

3536
///
37+
#[allow(clippy::empty_docs)]
3638
pub mod file;

Diff for: gix-command/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ pub fn extract_interpreter(executable: &Path) -> Option<shebang::Data> {
330330
}
331331

332332
///
333+
#[allow(clippy::empty_docs)]
333334
pub mod shebang {
334335
use bstr::{BStr, ByteSlice};
335336
use std::ffi::OsString;

Diff for: gix-commitgraph/src/file/access.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use std::{
2-
convert::TryInto,
32
fmt::{Debug, Formatter},
43
path::Path,
54
};

Diff for: gix-commitgraph/src/file/commit.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Low-level operations on individual commits.
22
use std::{
3-
convert::TryInto,
43
fmt::{Debug, Formatter},
54
slice::Chunks,
65
};

Diff for: gix-commitgraph/src/file/init.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1+
use std::path::Path;
12
use std::path::PathBuf;
2-
use std::{
3-
convert::{TryFrom, TryInto},
4-
path::Path,
5-
};
63

74
use bstr::ByteSlice;
85
use memmap2::Mmap;

Diff for: gix-commitgraph/src/init.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use std::{
2-
convert::TryFrom,
32
io::{BufRead, BufReader},
43
path::{Path, PathBuf},
54
};

Diff for: gix-commitgraph/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ pub fn at(path: impl AsRef<Path>) -> Result<Graph, init::Error> {
5151
mod access;
5252
pub mod file;
5353
///
54+
#[allow(clippy::empty_docs)]
5455
pub mod init;
5556
pub mod verify;
5657

Diff for: gix-commitgraph/src/verify.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
use std::{
33
cmp::{max, min},
44
collections::BTreeMap,
5-
convert::TryInto,
65
path::PathBuf,
76
};
87

Diff for: gix-commitgraph/tests/commitgraph.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std::{
22
collections::{HashMap, HashSet},
3-
convert::{TryFrom, TryInto},
43
hash::BuildHasher,
54
io::{BufRead, Cursor},
65
path::Path,

Diff for: gix-config-value/src/boolean.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{borrow::Cow, convert::TryFrom, ffi::OsString, fmt::Display};
1+
use std::{borrow::Cow, ffi::OsString, fmt::Display};
22

33
use bstr::{BStr, BString, ByteSlice};
44

Diff for: gix-config-value/src/color.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(missing_docs)]
2-
use std::{borrow::Cow, convert::TryFrom, fmt::Display, str::FromStr};
2+
use std::{borrow::Cow, fmt::Display, str::FromStr};
33

44
use bstr::{BStr, BString};
55

Diff for: gix-config-value/src/integer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{borrow::Cow, convert::TryFrom, fmt::Display, str::FromStr};
1+
use std::{borrow::Cow, fmt::Display, str::FromStr};
22

33
use bstr::{BStr, BString};
44

Diff for: gix-config-value/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,13 @@ impl Error {
3737

3838
mod boolean;
3939
///
40+
#[allow(clippy::empty_docs)]
4041
pub mod color;
4142
///
43+
#[allow(clippy::empty_docs)]
4244
pub mod integer;
4345
///
46+
#[allow(clippy::empty_docs)]
4447
pub mod path;
4548

4649
mod types;

Diff for: gix-config-value/src/path.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use bstr::BStr;
55
use crate::Path;
66

77
///
8+
#[allow(clippy::empty_docs)]
89
pub mod interpolate {
910
use std::path::PathBuf;
1011

Diff for: gix-config-value/tests/value/boolean.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::convert::TryFrom;
2-
31
use gix_config_value::Boolean;
42

53
use crate::b;

Diff for: gix-config-value/tests/value/color.rs

-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ mod attribute {
110110
}
111111

112112
mod from_git {
113-
use std::convert::TryFrom;
114-
115113
use bstr::BStr;
116114
use gix_config_value::Color;
117115

Diff for: gix-config-value/tests/value/integer.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::convert::TryFrom;
2-
31
use gix_config_value::{integer::Suffix, Integer};
42

53
use crate::b;

Diff for: gix-config/benches/large_config_file.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::convert::TryFrom;
2-
31
use criterion::{black_box, criterion_group, criterion_main, Criterion};
42
use gix_config::{parse::Events, File};
53

Diff for: gix-config/src/file/access/comfort.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{borrow::Cow, convert::TryFrom};
1+
use std::borrow::Cow;
22

33
use bstr::BStr;
44

Diff for: gix-config/src/file/access/raw.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{borrow::Cow, collections::HashMap, convert::TryInto};
1+
use std::{borrow::Cow, collections::HashMap};
22

33
use bstr::BStr;
44
use smallvec::ToSmallVec;

Diff for: gix-config/src/file/access/read_only.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{borrow::Cow, convert::TryFrom};
1+
use std::borrow::Cow;
22

33
use bstr::{BStr, ByteSlice};
44
use gix_features::threading::OwnShared;

Diff for: gix-config/src/file/impls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{borrow::Cow, convert::TryFrom, fmt::Display, str::FromStr};
1+
use std::{borrow::Cow, fmt::Display, str::FromStr};
22

33
use bstr::{BStr, BString, ByteVec};
44

Diff for: gix-config/src/file/includes/types.rs

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ impl Default for Options<'_> {
115115
}
116116

117117
///
118+
#[allow(clippy::empty_docs)]
118119
pub mod conditional {
119120
/// Options to handle conditional includes like `includeIf.<condition>.path`.
120121
#[derive(Clone, Copy, Default)]

Diff for: gix-config/src/file/init/comfort.rs

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ impl File<'static> {
141141
}
142142

143143
///
144+
#[allow(clippy::empty_docs)]
144145
pub mod from_git_dir {
145146
use crate::file::init;
146147

Diff for: gix-config/src/file/init/from_env.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::convert::TryFrom;
2-
31
use bstr::{BStr, ByteSlice};
42

53
use crate::{file, file::init, parse, parse::section, path::interpolate, File};

Diff for: gix-config/src/file/init/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ pub use types::{Error, Options};
1010

1111
mod comfort;
1212
///
13+
#[allow(clippy::empty_docs)]
1314
pub mod from_env;
1415
///
16+
#[allow(clippy::empty_docs)]
1517
pub mod from_paths;
1618

1719
impl<'a> File<'a> {

0 commit comments

Comments
 (0)