Skip to content

Commit

Permalink
build(deps): update itoa requirement from 0.4 to 1.0 (#28)
Browse files Browse the repository at this point in the history
* build(deps): update itoa requirement from 0.4 to 1.0

Updates the requirements on [itoa](https://github.com/dtolnay/itoa) to permit the latest version.
- [Release notes](https://github.com/dtolnay/itoa/releases)
- [Commits](dtolnay/itoa@0.4.0...1.0.1)

---
updated-dependencies:
- dependency-name: itoa
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* src/encoding/text: Adjust to breaking itoa changes

* *: Bump version and add changelog entry

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
  • Loading branch information
dependabot[bot] and mxinden authored Dec 19, 2021
1 parent c579da3 commit ce41d39
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.13.1] - unreleased

### Changed

- Update to `itoa` `v1`. See [PR 28].

[PR 28]: https://github.com/mxinden/rust-open-metrics-client/pull/28

## [0.13.0] - 2021-11-21

_Note: This was initially released as `v0.12.1` but later on yanked due to it
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "open-metrics-client"
version = "0.13.0"
version = "0.13.1"
authors = ["Max Inden <mail@max-inden.de>"]
edition = "2018"
description = "Open Metrics client library allowing users to natively instrument applications."
Expand All @@ -15,7 +15,7 @@ members = ["derive-text-encode"]

[dependencies]
dtoa = "0.4"
itoa = "0.4"
itoa = "1.0"
owning_ref = "0.4"
open-metrics-client-derive-text-encode = { version = "0.1.1", path = "derive-text-encode" }

Expand Down
8 changes: 4 additions & 4 deletions src/encoding/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ impl Encode for f64 {
}

impl Encode for u64 {
fn encode(&self, mut writer: &mut dyn Write) -> Result<(), std::io::Error> {
itoa::write(&mut writer, *self)?;
fn encode(&self, writer: &mut dyn Write) -> Result<(), std::io::Error> {
writer.write_all(itoa::Buffer::new().format(*self).as_bytes())?;
Ok(())
}
}

impl Encode for u32 {
fn encode(&self, mut writer: &mut dyn Write) -> Result<(), std::io::Error> {
itoa::write(&mut writer, *self)?;
fn encode(&self, writer: &mut dyn Write) -> Result<(), std::io::Error> {
writer.write_all(itoa::Buffer::new().format(*self).as_bytes())?;
Ok(())
}
}
Expand Down

0 comments on commit ce41d39

Please sign in to comment.