Skip to content

Commit 02807e7

Browse files
committed
lint: satisfy cargo-rbmt no-default clippy
1 parent 80c15a2 commit 02807e7

3 files changed

Lines changed: 15 additions & 8 deletions

File tree

clippy.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
msrv = "1.79.0"
21
# We have an error type, `RichError`, of size 144. This is pushing it but probably fine.
32
large-error-threshold = 145
43

5-
doc-valid-idents = [ "SimplicityHL" ]
4+
doc-valid-idents = [ "SimplicityHL" ]

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ pub(crate) mod tests {
554554
}
555555
}
556556

557+
#[cfg(feature = "serde")]
557558
pub fn get_encoding(self) -> String {
558559
let program_bytes = self.program.commit().to_vec_without_witness();
559560
Base64Display::new(&program_bytes, &STANDARD).to_string()
@@ -615,6 +616,7 @@ pub(crate) mod tests {
615616
}
616617
}
617618

619+
#[cfg(feature = "serde")]
618620
pub fn get_encoding_with_witness(self) -> (String, String) {
619621
let (program_bytes, witness_bytes) = self.program.redeem().to_vec_with_witness();
620622
(

src/main.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,20 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
236236

237237
if output_json {
238238
#[cfg(not(feature = "serde"))]
239-
return Err(
240-
"Program was compiled without the 'serde' feature and cannot output JSON.".into(),
241-
);
239+
{
240+
return Err(
241+
"Program was compiled without the 'serde' feature and cannot output JSON.".into(),
242+
);
243+
}
244+
242245
#[cfg(feature = "serde")]
243-
println!("{}", serde_json::to_string(&output)?);
244-
} else {
245-
println!("{}", output);
246+
{
247+
println!("{}", serde_json::to_string(&output)?);
248+
return Ok(());
249+
}
246250
}
247251

252+
println!("{}", output);
253+
248254
Ok(())
249255
}

0 commit comments

Comments
 (0)