From 4f42ad7ef242f6d243e4de90cd1b46a57690d00e Mon Sep 17 00:00:00 2001 From: Julien Cretin Date: Thu, 12 Sep 2024 19:00:47 +0200 Subject: [PATCH] Improve documentation of decode_len (#112) Fixes #111 --- bin/Cargo.toml | 2 +- lib/CHANGELOG.md | 6 ++++++ lib/Cargo.toml | 2 +- lib/macro/Cargo.toml | 6 +++--- lib/macro/internal/Cargo.toml | 4 ++-- lib/src/lib.rs | 5 +++-- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/bin/Cargo.toml b/bin/Cargo.toml index ecb031a..180b0dc 100644 --- a/bin/Cargo.toml +++ b/bin/Cargo.toml @@ -16,5 +16,5 @@ name = "data-encoding" path = "src/main.rs" [dependencies] -data-encoding = { version = "2.6.0", path = "../lib" } +data-encoding = { version = "2.6.1-git", path = "../lib" } getopts = "0.2" diff --git a/lib/CHANGELOG.md b/lib/CHANGELOG.md index d8ebdb6..4e4414b 100644 --- a/lib/CHANGELOG.md +++ b/lib/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2.6.1-git + +### Patch + +- Improve documentation of `Encoding::decode_len()` (fixes #111) + ## 2.6.0 ### Minor diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 1665c2d..fcdc877 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "data-encoding" -version = "2.6.0" +version = "2.6.1-git" authors = ["Julien Cretin "] license = "MIT" edition = "2018" diff --git a/lib/macro/Cargo.toml b/lib/macro/Cargo.toml index 7c6b04e..78ab99b 100644 --- a/lib/macro/Cargo.toml +++ b/lib/macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "data-encoding-macro" -version = "0.1.15" +version = "0.1.16-git" authors = ["Julien Cretin "] license = "MIT" edition = "2018" @@ -14,5 +14,5 @@ description = "Macros for data-encoding" include = ["Cargo.toml", "LICENSE", "README.md", "src/lib.rs"] [dependencies] -data-encoding = { version = "2.6.0", path = "..", default-features = false } -data-encoding-macro-internal = { version = "0.1.13", path = "internal" } +data-encoding = { version = "2.6.1-git", path = "..", default-features = false } +data-encoding-macro-internal = { version = "0.1.14-git", path = "internal" } diff --git a/lib/macro/internal/Cargo.toml b/lib/macro/internal/Cargo.toml index 5f6093f..f39a829 100644 --- a/lib/macro/internal/Cargo.toml +++ b/lib/macro/internal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "data-encoding-macro-internal" -version = "0.1.13" +version = "0.1.14-git" authors = ["Julien Cretin "] license = "MIT" edition = "2018" @@ -14,7 +14,7 @@ include = ["Cargo.toml", "LICENSE", "README.md", "src/lib.rs"] proc-macro = true [dependencies.data-encoding] -version = "2.6.0" +version = "2.6.1-git" path = "../.." default-features = false features = ["alloc"] diff --git a/lib/src/lib.rs b/lib/src/lib.rs index a18e6c2..8ea7ed1 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -1393,9 +1393,10 @@ impl Encoding { unsafe { String::from_utf8_unchecked(output) } } - /// Returns the decoded length of an input of length `len` + /// Returns the maximum decoded length of an input of length `len` /// - /// See [`decode_mut`] for when to use it. + /// See [`decode_mut`] for when to use it. In particular, the actual decoded length might be + /// smaller if the actual input contains padding or ignored characters. /// /// # Errors ///