Skip to content

Commit 44c7632

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

File tree

339 files changed

+589
-270
lines changed

Some content is hidden

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

339 files changed

+589
-270
lines changed

gitoxide-core/src/repository/credential.rs

Lines changed: 0 additions & 2 deletions
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)]

gix-actor/src/lib.rs

Lines changed: 1 addition & 0 deletions
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.

gix-actor/src/signature/mod.rs

Lines changed: 1 addition & 0 deletions
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;

gix-attributes/src/lib.rs

Lines changed: 4 additions & 0 deletions
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.

gix-attributes/src/search/outcome.rs

Lines changed: 7 additions & 3 deletions
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
}

gix-bitmap/src/ewah.rs

Lines changed: 1 addition & 4 deletions
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 {

gix-bitmap/src/lib.rs

Lines changed: 0 additions & 2 deletions
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 {

gix-chunk/src/file/decode.rs

Lines changed: 1 addition & 1 deletion
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()`]

gix-chunk/src/file/index.rs

Lines changed: 2 additions & 0 deletions
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)]

gix-chunk/src/file/mod.rs

Lines changed: 3 additions & 0 deletions
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.

gix-chunk/src/lib.rs

Lines changed: 3 additions & 1 deletion
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;

gix-command/src/lib.rs

Lines changed: 1 addition & 0 deletions
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;

gix-commitgraph/src/file/access.rs

Lines changed: 0 additions & 1 deletion
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
};

gix-commitgraph/src/file/commit.rs

Lines changed: 0 additions & 1 deletion
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
};

gix-commitgraph/src/file/init.rs

Lines changed: 1 addition & 4 deletions
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;

gix-commitgraph/src/init.rs

Lines changed: 0 additions & 1 deletion
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
};

gix-commitgraph/src/lib.rs

Lines changed: 1 addition & 0 deletions
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

gix-commitgraph/src/verify.rs

Lines changed: 0 additions & 1 deletion
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

gix-commitgraph/tests/commitgraph.rs

Lines changed: 0 additions & 1 deletion
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,

gix-config-value/src/boolean.rs

Lines changed: 1 addition & 1 deletion
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

gix-config-value/src/color.rs

Lines changed: 1 addition & 1 deletion
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

gix-config-value/src/integer.rs

Lines changed: 1 addition & 1 deletion
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

gix-config-value/src/lib.rs

Lines changed: 3 additions & 0 deletions
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;

gix-config-value/src/path.rs

Lines changed: 1 addition & 0 deletions
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

gix-config-value/tests/value/boolean.rs

Lines changed: 0 additions & 2 deletions
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;

gix-config-value/tests/value/color.rs

Lines changed: 0 additions & 2 deletions
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

gix-config-value/tests/value/integer.rs

Lines changed: 0 additions & 2 deletions
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;

gix-config/src/file/access/comfort.rs

Lines changed: 1 addition & 1 deletion
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

gix-config/src/file/access/raw.rs

Lines changed: 1 addition & 1 deletion
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;

gix-config/src/file/access/read_only.rs

Lines changed: 1 addition & 1 deletion
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;

gix-config/src/file/impls.rs

Lines changed: 1 addition & 1 deletion
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

gix-config/src/file/includes/types.rs

Lines changed: 1 addition & 0 deletions
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)]

gix-config/src/file/init/comfort.rs

Lines changed: 1 addition & 0 deletions
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

gix-config/src/file/init/from_env.rs

Lines changed: 0 additions & 2 deletions
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};

gix-config/src/file/init/mod.rs

Lines changed: 2 additions & 0 deletions
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> {

gix-config/src/file/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,23 @@ mod mutable;
1313
pub use mutable::{multi_value::MultiValueMut, section::SectionMut, value::ValueMut};
1414

1515
///
16+
#[allow(clippy::empty_docs)]
1617
pub mod init;
1718

1819
mod access;
1920
mod impls;
2021
///
22+
#[allow(clippy::empty_docs)]
2123
pub mod includes;
2224
mod meta;
2325
mod util;
2426

2527
///
28+
#[allow(clippy::empty_docs)]
2629
pub mod section;
2730

2831
///
32+
#[allow(clippy::empty_docs)]
2933
pub mod rename_section {
3034
/// The error returned by [`File::rename_section(…)`][crate::File::rename_section()].
3135
#[derive(Debug, thiserror::Error)]
@@ -39,6 +43,7 @@ pub mod rename_section {
3943
}
4044

4145
///
46+
#[allow(clippy::empty_docs)]
4247
pub mod set_raw_value {
4348
/// The error returned by [`File::set_raw_value(…)`][crate::File::set_raw_value()].
4449
#[derive(Debug, thiserror::Error)]

gix-config/src/file/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::{
66
};
77

88
mod try_from {
9-
use std::{borrow::Cow, collections::HashMap, convert::TryFrom};
9+
use std::{borrow::Cow, collections::HashMap};
1010

1111
use super::{bodies, headers};
1212
use crate::{

gix-config/src/file/util.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ impl<'event> File<'event> {
118118
&'a self,
119119
section_name: &'a str,
120120
subsection_name: Option<&BStr>,
121-
) -> Result<impl Iterator<Item = SectionId> + ExactSizeIterator + DoubleEndedIterator + '_, lookup::existing::Error>
122-
{
121+
) -> Result<impl ExactSizeIterator<Item = SectionId> + DoubleEndedIterator + '_, lookup::existing::Error> {
123122
let section_name = section::Name::from_str_unchecked(section_name);
124123
let section_ids = self
125124
.section_lookup_tree

gix-config/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,16 @@
4040
pub mod file;
4141

4242
///
43+
#[allow(clippy::empty_docs)]
4344
pub mod lookup;
4445
pub mod parse;
4546
///
47+
#[allow(clippy::empty_docs)]
4648
pub mod value;
4749
pub use gix_config_value::{color, integer, path, Boolean, Color, Integer, Path};
4850

4951
mod types;
5052
pub use types::{File, Source};
5153
///
54+
#[allow(clippy::empty_docs)]
5255
pub mod source;

0 commit comments

Comments
 (0)