• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rust-bitcoin / rust-bitcoin / 8269012797 / 1
83%
master: 83%

Build:
DEFAULT BRANCH: master
Ran 13 Mar 2024 05:29PM UTC
Files 88
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Mar 2024 05:28PM UTC coverage: 84.144% (+0.02%) from 84.12%
8269012797.1

push

github

apoelstra
Merge rust-bitcoin/rust-bitcoin#2565: Removes txid prefix in transaction IDs

<a class=hub.com/rust-bitcoin/rust-bitcoin/commit/<a class="double-link" href="https://git"><a class=hub.com/rust-bitcoin/rust-bitcoin/commit/56132f59d56782d200a9d5eec78336c1f5e55fec">56132f59d     Remove the `:#` formatting for `hex_fmt_impl` macro (448 OG)

Pull request description:

  This commit attempts to solve #2505  by ensuring that formatting is not forced using the `:#` in the hex macro code generating in macro rule `hex_fmt_impl` in the hashes/utils.rs file.

  The write! macro forces all formatting to add the prefix `0x` by adding an alternate by (#) default

  ```rust
  impl<$($gen: $gent),*> $crate::_export::_core::fmt::Debug for $ty<$($gen),*> {
              #[inline]
              fn fmt(&self, f: &mut $crate::_export::_core::fmt::Formatter) -> $crate::_export::_core::fmt::Result {
                  write!(f, "{:#}", self) // <-- This is where the formatting is being forced.
              }
          }
  ```

  By removing this formatting, the `:#` must be specified by the user in order for a prefix to be added.

  ```rust
  let outpoint = bitcoin::OutPoint::default();
      println!("{:?}", &outpoint);
      println!("{:#?}", &outpoint);
      println!("{:#}", &outpoint);
      println!("{:x}", &outpoint.txid);
      // `{:#}` must be specified to pretty print with a prefix
      println!("{:#}", &outpoint.txid);
      dbg!(&outpoint);
      dbg!(&outpoint.txid);
  ```

  The PR also adds testcase for this when running `cargo test` .

ACKs for top commit:
  tcharding:
    ACK 56132f59d56782d200a9d5eec78336c1f5e55fec
  apoelstra:
    ACK 56132f59d56782d200a9d5eec78336c1f5e55fec

Tree-SHA512: 9e4fc9f307ae3a82bb37587cc0c10d98ebc

19667 of 23373 relevant lines covered (84.14%)

16533.0 hits per line

Source Files on job 8269012797.1
  • Tree
  • List 0
  • Changed 12
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 8269012797
  • 1ceac90b on github
  • Prev Job for on master (#8268759758.1)
  • Next Job for on master (#8276893111.1)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc