summaryrefslogtreecommitdiffstats
path: root/openpgp/src
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2023-03-08 01:05:34 +0100
committerJustus Winter <justus@sequoia-pgp.org>2023-03-13 15:24:20 +0100
commit62e52e7b1d88c98a5be051c407024e68ca506a90 (patch)
tree3b9052183a08b55d2fea3c6115d681c09c748cf7 /openpgp/src
parentbee82c2952512a5585e93f180180ca45468d4f2b (diff)
openpgp: New constructor hex::Dumper::with_offset.
Diffstat (limited to 'openpgp/src')
-rw-r--r--openpgp/src/fmt.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/openpgp/src/fmt.rs b/openpgp/src/fmt.rs
index 5f3cd206..65b1b79c 100644
--- a/openpgp/src/fmt.rs
+++ b/openpgp/src/fmt.rs
@@ -71,10 +71,21 @@ pub mod hex {
/// The dump is written to `inner`. Every line is indented with
/// `indent`.
pub fn new<I: AsRef<str>>(inner: W, indent: I) -> Self {
+ Self::with_offset(inner, indent, 0)
+ }
+
+ /// Creates a new dumper starting at the given offset.
+ ///
+ /// The dump is written to `inner`. Every line is indented with
+ /// `indent`.
+ pub fn with_offset<I>(inner: W, indent: I, offset: usize) -> Self
+ where
+ I: AsRef<str>,
+ {
Dumper {
inner,
indent: indent.as_ref().into(),
- offset: 0,
+ offset,
}
}