Skip to content

Commit c457f41

Browse files
authored
Merge pull request #6175 from jferrant/chore/fix-stx-genesis-clippy
Add clippy to stx-genesis
2 parents c324e57 + d2d8436 commit c457f41

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[alias]
22
stacks-node = "run --package stacks-node --"
33
fmt-stacks = "fmt -- --config group_imports=StdExternalCrate,imports_granularity=Module"
4-
clippy-stacks = "clippy -p libstackerdb -p stacks-signer -p pox-locking -p clarity -p libsigner -p stacks-common --no-deps --tests --all-features -- -D warnings"
4+
clippy-stacks = "clippy -p stx-genesis -p libstackerdb -p stacks-signer -p pox-locking -p clarity -p libsigner -p stacks-common --no-deps --tests --all-features -- -D warnings"
55

66
# Uncomment to improve performance slightly, at the cost of portability
77
# * Note that native binaries may not run on CPUs that are different from the build machine

stx-genesis/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fn write_chainstate_archive(
8686
.skip(2)
8787
.take_while(|line| !line.eq(&section_footer))
8888
{
89-
encoder.write_all(&[line.as_bytes(), &[b'\n']].concat())?;
89+
encoder.write_all(&[line.as_bytes(), b"\n"].concat())?;
9090
}
9191

9292
let mut out_file = encoder.finish().into_result().unwrap();

stx-genesis/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ fn read_deflated_zonefiles(
119119
zonefile_hash: pair[0].to_owned(),
120120
zonefile_content: pair[1].replace("\\n", "\n"),
121121
});
122-
return Box::new(pair_iter);
122+
Box::new(pair_iter)
123123
}
124124

125125
fn iter_deflated_csv(deflate_bytes: &'static [u8]) -> Box<dyn Iterator<Item = Vec<String>>> {
@@ -130,15 +130,15 @@ fn iter_deflated_csv(deflate_bytes: &'static [u8]) -> Box<dyn Iterator<Item = Ve
130130
.lines()
131131
.map(|line| line.unwrap())
132132
.map(|line| line.split(',').map(String::from).collect());
133-
return Box::new(line_iter);
133+
Box::new(line_iter)
134134
}
135135

136136
fn read_balances(deflate_bytes: &'static [u8]) -> Box<dyn Iterator<Item = GenesisAccountBalance>> {
137137
let balances = iter_deflated_csv(deflate_bytes).map(|cols| GenesisAccountBalance {
138138
address: cols[0].to_string(),
139139
amount: cols[1].parse::<u64>().unwrap(),
140140
});
141-
return Box::new(balances);
141+
Box::new(balances)
142142
}
143143

144144
fn read_lockups(deflate_bytes: &'static [u8]) -> Box<dyn Iterator<Item = GenesisAccountLockup>> {
@@ -147,7 +147,7 @@ fn read_lockups(deflate_bytes: &'static [u8]) -> Box<dyn Iterator<Item = Genesis
147147
amount: cols[1].parse::<u64>().unwrap(),
148148
block_height: cols[2].parse::<u64>().unwrap(),
149149
});
150-
return Box::new(lockups);
150+
Box::new(lockups)
151151
}
152152

153153
fn read_namespaces(deflate_bytes: &'static [u8]) -> Box<dyn Iterator<Item = GenesisNamespace>> {
@@ -161,7 +161,7 @@ fn read_namespaces(deflate_bytes: &'static [u8]) -> Box<dyn Iterator<Item = Gene
161161
no_vowel_discount: cols[6].parse::<i64>().unwrap(),
162162
lifetime: cols[7].parse::<i64>().unwrap(),
163163
});
164-
return Box::new(namespaces);
164+
Box::new(namespaces)
165165
}
166166

167167
fn read_names(deflate_bytes: &'static [u8]) -> Box<dyn Iterator<Item = GenesisName>> {
@@ -170,7 +170,7 @@ fn read_names(deflate_bytes: &'static [u8]) -> Box<dyn Iterator<Item = GenesisNa
170170
owner: cols[1].to_string(),
171171
zonefile_hash: cols[2].to_string(),
172172
});
173-
return Box::new(names);
173+
Box::new(names)
174174
}
175175

176176
#[cfg(test)]

0 commit comments

Comments
 (0)