Skip to content

Commit 7ec7a2b

Browse files
siriakPanquesito7
andauthored
Fix linting errors (TheAlgorithms#207)
Co-authored-by: David Leal <halfpacho@gmail.com>
1 parent b7ef250 commit 7ec7a2b

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @siriak

src/data_structures/b_tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl BTreeProps {
112112
// And https://stackoverflow.com/a/35280799/2849127
113113
print!("{0:{<1$}{2:?}{0:}<1$}", "", depth, key);
114114
}
115-
self.traverse_node(&node.children.last().unwrap(), _depth);
115+
self.traverse_node(node.children.last().unwrap(), _depth);
116116
}
117117
}
118118
}

src/data_structures/binary_search_tree.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ where
3939
pub fn search(&self, value: &T) -> bool {
4040
match &self.value {
4141
Some(key) => {
42-
match key.cmp(&value) {
42+
match key.cmp(value) {
4343
Ordering::Equal => {
4444
// key == value
4545
true
@@ -123,7 +123,7 @@ where
123123
pub fn floor(&self, value: &T) -> Option<&T> {
124124
match &self.value {
125125
Some(key) => {
126-
match key.cmp(&value) {
126+
match key.cmp(value) {
127127
Ordering::Greater => {
128128
// key > value
129129
match &self.left {
@@ -138,13 +138,13 @@ where
138138
let val = node.floor(value);
139139
match val {
140140
Some(_) => val,
141-
None => Some(&key),
141+
None => Some(key),
142142
}
143143
}
144-
None => Some(&key),
144+
None => Some(key),
145145
}
146146
}
147-
Ordering::Equal => Some(&key),
147+
Ordering::Equal => Some(key),
148148
}
149149
}
150150
None => None,
@@ -155,7 +155,7 @@ where
155155
pub fn ceil(&self, value: &T) -> Option<&T> {
156156
match &self.value {
157157
Some(key) => {
158-
match key.cmp(&value) {
158+
match key.cmp(value) {
159159
Ordering::Less => {
160160
// key < value
161161
match &self.right {
@@ -170,15 +170,15 @@ where
170170
let val = node.ceil(value);
171171
match val {
172172
Some(_) => val,
173-
None => Some(&key),
173+
None => Some(key),
174174
}
175175
}
176-
None => Some(&key),
176+
None => Some(key),
177177
}
178178
}
179179
Ordering::Equal => {
180180
// key == value
181-
Some(&key)
181+
Some(key)
182182
}
183183
}
184184
}

src/general/convex_hull.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn convex_hull_graham(pts: &[(f64, f64)]) -> Vec<(f64, f64)> {
4545
}
4646
})
4747
.unwrap();
48-
let points = sort_by_min_angle(pts, &min);
48+
let points = sort_by_min_angle(pts, min);
4949

5050
if points.len() <= 3 {
5151
return points;

src/sorting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ where
3434
return false;
3535
}
3636

37-
prev = &item;
37+
prev = item;
3838
}
3939

4040
true

0 commit comments

Comments
 (0)