Skip to content

Commit d5846bb

Browse files
author
Jason Heath
committed
Revved rust from 1.62.1 to 1.67.1
- Address Clippy warnings while upgrading from 1.62.1 to 1.67.1 - A fix for the change in signal masking introduced in rust-lang/rust#101077 - Changes to address an instance of https://rust-lang.github.io/rust-clippy/master/index.html\#result_large_err Signed-off-by: Jason Heath <jason.heath@progress.com>
1 parent ee5cd3e commit d5846bb

Some content is hidden

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

73 files changed

+282
-280
lines changed

.rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ unstable_features = true
66

77
# stable options
88
edition = "2018"
9-
fn_args_layout = "Tall"
9+
fn_params_layout = "Tall"
1010
force_explicit_abi = true
1111
format_code_in_doc_comments = true
1212
hard_tabs = false

components/builder-api-client/src/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl BuilderAPIClient {
190190
let resp = self.maybe_add_authz(rb, token).send().await?;
191191
let resp = response::ok_if(resp, &[StatusCode::OK]).await?;
192192

193-
fs::create_dir_all(&dst_path)?;
193+
fs::create_dir_all(dst_path)?;
194194
let file_name = response::get_header(&resp, X_FILENAME)?;
195195
let dst_file_path = dst_path.join(file_name);
196196
let w = AtomicWriter::new_with_permissions(&dst_file_path, permissions)?;
@@ -1609,7 +1609,7 @@ mod tests {
16091609
(range, (range + step).min(last))
16101610
};
16111611
let filtered_range = filtered[start..=end].iter()
1612-
.map(|s| get_test_ident(**s))
1612+
.map(|s| get_test_ident(s))
16131613
.collect::<Vec<_>>();
16141614
let result = PackageResults { range_start: start as isize,
16151615
range_end: end as isize,

components/butterfly/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@ impl Client {
8181
{
8282
let bytes = rumor.write_to_bytes()?;
8383
let wire_msg = message::generate_wire(bytes, self.ring_key.as_ref())?;
84-
self.socket.send(&wire_msg, 0).map_err(Error::ZmqSendError)
84+
self.socket.send(wire_msg, 0).map_err(Error::ZmqSendError)
8585
}
8686
}

components/butterfly/src/member.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ impl Default for Member {
174174
}
175175

176176
impl From<Member> for RumorKey {
177-
fn from(member: Member) -> RumorKey { RumorKey::new(RumorType::Member, &member.id, "") }
177+
fn from(member: Member) -> RumorKey { RumorKey::new(RumorType::Member, member.id, "") }
178178
}
179179

180180
impl<'a> From<&'a Member> for RumorKey {

components/butterfly/src/protocol/swim.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ mod tests {
2424

2525
#[test]
2626
fn health_values_are_title_case() {
27-
assert_eq!(serde_json::to_value(&Health::Alive).unwrap(), "Alive");
28-
assert_eq!(serde_json::to_value(&Health::Suspect).unwrap(), "Suspect");
29-
assert_eq!(serde_json::to_value(&Health::Confirmed).unwrap(),
27+
assert_eq!(serde_json::to_value(Health::Alive).unwrap(), "Alive");
28+
assert_eq!(serde_json::to_value(Health::Suspect).unwrap(), "Suspect");
29+
assert_eq!(serde_json::to_value(Health::Confirmed).unwrap(),
3030
"Confirmed");
31-
assert_eq!(serde_json::to_value(&Health::Departed).unwrap(), "Departed");
31+
assert_eq!(serde_json::to_value(Health::Departed).unwrap(), "Departed");
3232
}
3333
}

components/butterfly/src/rumor/dat_file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ impl DatFile {
368368
{
369369
let mut bytes_read = 0;
370370
let mut size_buf = [0; 8];
371-
let mut rumor_buf: Vec<u8> = vec![];
371+
let mut rumor_buf: Vec<u8> = vec![0; 8];
372372

373373
loop {
374374
if bytes_read >= offset {

components/butterfly/src/rumor/heat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub(crate) mod sync {
7575
.collect();
7676

7777
// Reverse sorting by heat; 0s come last!
78-
rumor_heat.sort_by(|&(_, ref h1), &(_, ref h2)| h2.cmp(h1));
78+
rumor_heat.sort_by(|(_, h1), (_, h2)| h2.cmp(h1));
7979

8080
// We don't need the heat anymore, just return the rumors.
8181
rumor_heat.into_iter().map(|(k, _)| k).collect()

components/butterfly/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ impl Server {
748748
rumor_heat.lock_rhw().purge(member_id_to_depart);
749749
rumor_heat.lock_rhw()
750750
.start_hot_rumor(RumorKey::new(RumorType::Member,
751-
&*member_id_to_depart,
751+
member_id_to_depart,
752752
""));
753753
}
754754
}

components/butterfly/src/server/incarnation_store.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ mod tests {
9797
"The path {:?} shouldn't exist, but it does",
9898
path);
9999

100-
let i = IncarnationStore::new(&path);
100+
let i = IncarnationStore::new(path);
101101
assert!(i.load().is_err());
102102
}
103103

@@ -155,13 +155,13 @@ mod tests {
155155
let tempfile = Temp::new_file().expect("Could not create temp file");
156156
let path = tempfile.as_ref();
157157

158-
let mut buffer = File::create(&path).expect("could not create file");
158+
let mut buffer = File::create(path).expect("could not create file");
159159
buffer.write_all(b"this, also, is not a u64")
160160
.expect("could not write file");
161161

162162
assert!(path.exists());
163163

164-
let mut i = IncarnationStore::new(&path);
164+
let mut i = IncarnationStore::new(path);
165165
assert!(i.initialize().is_err());
166166
}
167167
}

components/common/src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub fn is_toml_file(val: &str) -> bool {
6161
}
6262

6363
pub fn file_into_idents(path: &str) -> Result<Vec<PackageIdent>, habitat_core::error::Error> {
64-
let s = std::fs::read_to_string(&path).map_err(|_| {
64+
let s = std::fs::read_to_string(path).map_err(|_| {
6565
habitat_core::error::Error::FileNotFound(format!("Could not open file {}", path))
6666
})?;
6767

0 commit comments

Comments
 (0)