Skip to content

Commit

Permalink
Use BytesCount::of_many in BytesCount::of_iter
Browse files Browse the repository at this point in the history
  • Loading branch information
nvzqz committed Feb 17, 2024
1 parent 7f0d2ce commit 41dfe96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Versioning](http://semver.org/spec/v2.0.0.html).

- Improve [`args`] documentation by relating it to using [`Bencher`].

- Define [`BytesCount::of_iter`] in terms of [`BytesCount::of_many`].

## [0.1.13] - 2024-02-09

### Fixed
Expand Down Expand Up @@ -280,6 +282,8 @@ Initial release. See [blog post](https://nikolaivazquez.com/blog/divan/).
[`args`]: https://docs.rs/divan/latest/divan/attr.bench.html#args
[`Bencher`]: https://docs.rs/divan/0.1/divan/struct.Bencher.html
[`black_box`]: https://docs.rs/divan/latest/divan/fn.black_box.html
[`BytesCount::of_iter`]: https://docs.rs/divan/0.1/divan/counter/struct.BytesCount.html#method.of_iter
[`BytesCount::of_many`]: https://docs.rs/divan/0.1/divan/counter/struct.BytesCount.html#method.of_many
[`consts`]: https://docs.rs/divan/latest/divan/attr.bench.html#consts

[`Any`]: https://doc.rust-lang.org/std/any/trait.Any.html
Expand Down
2 changes: 1 addition & 1 deletion src/counter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl BytesCount {
where
I: IntoIterator<Item = T>,
{
Self::new(mem::size_of::<T>() * iter.into_iter().count())
Self::of_many::<T>(iter.into_iter().count())
}

/// Counts the bytes of a [`&str`].
Expand Down

0 comments on commit 41dfe96

Please # to comment.