Skip to content

Commit

Permalink
chore: modernize rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Aug 18, 2024
1 parent 9f6cdc2 commit 77a99ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
edition = "2021"
version = "Two"

max_width = 100
array_width = 100
Expand All @@ -8,9 +9,10 @@ chain_width = 100
fn_call_width = 100
single_line_if_else_max_width = 100

format_code_in_doc_comments = true
fn_single_line = true
format_code_in_doc_comments = true
format_macro_matchers = true
format_macro_bodies = true
format_strings = true
merge_derives = false
overflow_delimited_expr = true
Expand All @@ -22,4 +24,4 @@ where_single_line = true
unstable_features = true

imports_granularity = "Module"
group_imports = "StdExternalCrate"
group_imports = "StdExternalCrate"
4 changes: 2 additions & 2 deletions invoice/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,11 @@ impl FromStr for Address {
return Err(AddressParseError::FutureTaprootVersion(
program.len(),
s.to_owned(),
))
));

Check warning on line 261 in invoice/src/address.rs

View check run for this annotation

Codecov / codecov/patch

invoice/src/address.rs#L261

Added line #L261 was not covered by tests
}

(WitnessVer::V0 | WitnessVer::V1, wrong) => {
return Err(AddressParseError::InvalidBech32Variant(wrong))
return Err(AddressParseError::InvalidBech32Variant(wrong));

Check warning on line 265 in invoice/src/address.rs

View check run for this annotation

Codecov / codecov/patch

invoice/src/address.rs#L265

Added line #L265 was not covered by tests
}

(future, _) => return Err(AddressParseError::FutureWitnessVersion(future)),
Expand Down
6 changes: 3 additions & 3 deletions psbt/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -903,13 +903,13 @@ impl Input {
self.redeem_script = None; // 0x04
self.witness_script = None; // 0x05
self.bip32_derivation.clear(); // 0x05
// finalized witness 0x06 and 0x07 are not clear
// 0x09 Proof of reserves not yet supported
// finalized witness 0x06 and 0x07 are not clear
// 0x09 Proof of reserves not yet supported

Check warning on line 907 in psbt/src/data.rs

View check run for this annotation

Codecov / codecov/patch

psbt/src/data.rs#L906-L907

Added lines #L906 - L907 were not covered by tests
self.ripemd160.clear(); // 0x0a
self.sha256.clear(); // 0x0b
self.hash160.clear(); // 0x0c
self.hash256.clear(); // 0x0d
// psbt v2 fields till 0x012 not supported
// psbt v2 fields till 0x012 not supported

Check warning on line 912 in psbt/src/data.rs

View check run for this annotation

Codecov / codecov/patch

psbt/src/data.rs#L912

Added line #L912 was not covered by tests
self.tap_key_sig = None; // 0x013
self.tap_script_sig.clear(); // 0x014
self.tap_leaf_script.clear(); // 0x015
Expand Down

0 comments on commit 77a99ae

Please sign in to comment.