Skip to content

Commit 7b944cd

Browse files
committed
Apply clippy fixes.
1 parent e93384e commit 7b944cd

21 files changed

+29
-94
lines changed

src/bin/c02p01.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ impl<T> Node<T> {
4343

4444
impl<T> LinkedList<T>
4545
where
46-
T: std::cmp::Eq,
47-
T: std::hash::Hash,
48-
T: std::clone::Clone,
46+
T: std::cmp::Eq + std::hash::Hash + std::clone::Clone,
4947
{
5048
fn new() -> Self {
5149
Self { head: None }

src/bin/c02p02.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ impl<T> Node<T> {
2828

2929
impl<T> LinkedList<T>
3030
where
31-
T: std::cmp::Eq,
32-
T: std::hash::Hash,
33-
T: std::clone::Clone,
31+
T: std::cmp::Eq + std::hash::Hash + std::clone::Clone,
3432
{
3533
fn new() -> Self {
3634
Self { head: None }

src/bin/c02p03.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ impl<T> Node<T> {
2828

2929
impl<T> LinkedList<T>
3030
where
31-
T: std::cmp::Eq,
32-
T: std::hash::Hash,
33-
T: std::clone::Clone,
31+
T: std::cmp::Eq + std::hash::Hash + std::clone::Clone,
3432
{
3533
fn new() -> Self {
3634
Self { head: None }

src/bin/c02p04.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ impl<T> Node<T> {
2828

2929
impl<T> LinkedList<T>
3030
where
31-
T: std::cmp::Eq,
32-
T: std::hash::Hash,
33-
T: std::clone::Clone,
34-
T: std::cmp::PartialOrd,
31+
T: std::cmp::Eq + std::hash::Hash + std::clone::Clone + std::cmp::PartialOrd,
3532
{
3633
fn new() -> Self {
3734
Self { head: None }

src/bin/c02p05.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ impl<T> Node<T> {
2828

2929
impl<T> LinkedList<T>
3030
where
31-
T: std::cmp::Eq,
32-
T: std::hash::Hash,
33-
T: std::clone::Clone,
34-
T: std::cmp::PartialOrd,
31+
T: std::cmp::Eq + std::hash::Hash + std::clone::Clone + std::cmp::PartialOrd,
3532
{
3633
fn new() -> Self {
3734
Self { head: None }

src/bin/c02p06.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ struct Iter<T> {
2222

2323
impl<T> LinkedList<T>
2424
where
25-
T: std::cmp::Eq,
26-
T: std::hash::Hash,
27-
T: std::clone::Clone,
28-
T: std::cmp::PartialOrd,
29-
T: std::fmt::Debug,
25+
T: std::cmp::Eq + std::hash::Hash + std::clone::Clone + std::cmp::PartialOrd + std::fmt::Debug,
3026
{
3127
fn new() -> Self {
3228
Self {

src/bin/c02p07.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ impl<T> Node<T> {
2929

3030
impl<T> LinkedList<T>
3131
where
32-
T: std::cmp::Eq,
33-
T: std::hash::Hash,
34-
T: std::clone::Clone,
35-
T: std::cmp::PartialOrd,
32+
T: std::cmp::Eq + std::hash::Hash + std::clone::Clone + std::cmp::PartialOrd,
3633
{
3734
fn new() -> Self {
3835
Self { head: None }

src/bin/c02p08.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ impl<T> Node<T> {
2828

2929
impl<T> LinkedList<T>
3030
where
31-
T: std::cmp::Eq,
32-
T: std::hash::Hash,
33-
T: std::clone::Clone,
34-
T: std::cmp::PartialOrd,
35-
T: std::cmp::PartialEq,
31+
T: std::cmp::Eq + std::hash::Hash + std::clone::Clone + std::cmp::PartialOrd + std::cmp::PartialEq,
3632
{
3733
fn new() -> Self {
3834
Self { head: None }

src/bin/c03p02.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ struct Stack<T> {
66

77
impl<T> Stack<T>
88
where
9-
T: std::cmp::PartialEq,
10-
T: std::cmp::PartialOrd,
11-
T: std::clone::Clone,
9+
T: std::cmp::PartialEq + std::cmp::PartialOrd + std::clone::Clone,
1210
{
1311
fn new() -> Self {
1412
Stack {

src/bin/c03p03.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ struct StackSet<T> {
66

77
impl<T> StackSet<T>
88
where
9-
T: std::cmp::PartialEq,
10-
T: std::cmp::PartialOrd,
11-
T: std::clone::Clone,
9+
T: std::cmp::PartialEq + std::cmp::PartialOrd + std::clone::Clone,
1210
{
1311
fn new(capacity: usize) -> Self {
1412
StackSet {

0 commit comments

Comments
 (0)