Skip to content

Commit

Permalink
Automatic deploy to GitHub Pages: eb679c7
Browse files Browse the repository at this point in the history
  • Loading branch information
GHA CI committed Dec 26, 2023
1 parent ce8020a commit 94e3d49
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions master/lints.json
Original file line number Diff line number Diff line change
Expand Up @@ -3299,7 +3299,7 @@
"group": "pedantic",
"level": "allow",
"docs": "\n### What it does\nThis is the opposite of the `iter_without_into_iter` lint.\nIt looks for `IntoIterator for (&|&mut) Type` implementations without an inherent `iter` or `iter_mut` method\non the type or on any of the types in its `Deref` chain.\n\n### Why is this bad?\nIt's not bad, but having them is idiomatic and allows the type to be used in iterator chains\nby just calling `.iter()`, instead of the more awkward `<&Type>::into_iter` or `(&val).into_iter()` syntax\nin case of ambiguity with another `IntoIterator` impl.\n\n### Limitations\nThis lint focuses on providing an idiomatic API. Therefore, it will only\nlint on types which are accessible outside of the crate. For internal types,\nthese methods can be added on demand if they are actually needed. Otherwise,\nit would trigger the [`dead_code`] lint for the unused method.\n\n[`dead_code`]: https://doc.rust-lang.org/rustc/lints/listing/warn-by-default.html#dead-code\n\n### Example\n```rust\nstruct MySlice<'a>(&'a [u8]);\nimpl<'a> IntoIterator for &MySlice<'a> {\n type Item = &'a u8;\n type IntoIter = std::slice::Iter<'a, u8>;\n fn into_iter(self) -> Self::IntoIter {\n self.0.iter()\n }\n}\n```\nUse instead:\n```rust\nstruct MySlice<'a>(&'a [u8]);\nimpl<'a> MySlice<'a> {\n pub fn iter(&self) -> std::slice::Iter<'a, u8> {\n self.into_iter()\n }\n}\nimpl<'a> IntoIterator for &MySlice<'a> {\n type Item = &'a u8;\n type IntoIter = std::slice::Iter<'a, u8>;\n fn into_iter(self) -> Self::IntoIter {\n self.0.iter()\n }\n}\n```",
"version": "1.74.0",
"version": "1.75.0",
"applicability": {
"is_multi_part_suggestion": false,
"applicability": "Unspecified"
Expand Down Expand Up @@ -3692,7 +3692,7 @@
"group": "pedantic",
"level": "allow",
"docs": "\n### What it does\nLooks for `iter` and `iter_mut` methods without an associated `IntoIterator for (&|&mut) Type` implementation.\n\n### Why is this bad?\nIt's not bad, but having them is idiomatic and allows the type to be used in for loops directly\n(`for val in &iter {}`), without having to first call `iter()` or `iter_mut()`.\n\n### Limitations\nThis lint focuses on providing an idiomatic API. Therefore, it will only\nlint on types which are accessible outside of the crate. For internal types,\nthe `IntoIterator` trait can be implemented on demand if it is actually needed.\n\n### Example\n```rust\nstruct MySlice<'a>(&'a [u8]);\nimpl<'a> MySlice<'a> {\n pub fn iter(&self) -> std::slice::Iter<'a, u8> {\n self.0.iter()\n }\n}\n```\nUse instead:\n```rust\nstruct MySlice<'a>(&'a [u8]);\nimpl<'a> MySlice<'a> {\n pub fn iter(&self) -> std::slice::Iter<'a, u8> {\n self.0.iter()\n }\n}\nimpl<'a> IntoIterator for &MySlice<'a> {\n type Item = &'a u8;\n type IntoIter = std::slice::Iter<'a, u8>;\n fn into_iter(self) -> Self::IntoIter {\n self.iter()\n }\n}\n```",
"version": "1.74.0",
"version": "1.75.0",
"applicability": {
"is_multi_part_suggestion": false,
"applicability": "Unspecified"
Expand Down Expand Up @@ -4232,7 +4232,7 @@
"group": "complexity",
"level": "warn",
"docs": "\n### What it does\nChecks for cases where [`BuildHasher::hash_one`] can be used.\n\n[`BuildHasher::hash_one`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html#method.hash_one\n\n### Why is this bad?\nIt is more concise to use the `hash_one` method.\n\n### Example\n```rust\nuse std::hash::{BuildHasher, Hash, Hasher};\nuse std::collections::hash_map::RandomState;\n\nlet s = RandomState::new();\nlet value = vec![1, 2, 3];\n\nlet mut hasher = s.build_hasher();\nvalue.hash(&mut hasher);\nlet hash = hasher.finish();\n```\nUse instead:\n```rust\nuse std::hash::BuildHasher;\nuse std::collections::hash_map::RandomState;\n\nlet s = RandomState::new();\nlet value = vec![1, 2, 3];\n\nlet hash = s.hash_one(&value);\n```\n\n### Configuration\nThis lint has the following configuration variables:\n\n- `msrv`: The minimum rust version that the project supports. Defaults to the `rust-version` field in `Cargo.toml`",
"version": "1.74.0",
"version": "1.75.0",
"applicability": {
"is_multi_part_suggestion": false,
"applicability": "MachineApplicable"
Expand Down

0 comments on commit 94e3d49

Please sign in to comment.