Skip to content

Commit 54a11bd

Browse files
oschwaldclaude
andcommitted
Make Decoder struct and methods pub(crate)
Decoder is not exported from the crate, so pub visibility was misleading. Changed to pub(crate) for clarity. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b306a46 commit 54a11bd

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/decoder.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,19 @@ enum Value<'a, 'de> {
5656
Array(ArrayAccess<'a, 'de>),
5757
}
5858

59-
/// Low-level decoder for MaxMind DB binary data.
59+
/// Decoder for MaxMind DB binary format.
6060
///
61-
/// This decoder implements serde's `Deserializer` trait to convert
62-
/// MaxMind DB binary format into Rust types. It handles pointer
63-
/// resolution, type coercion, and nested data structures.
64-
///
65-
/// Most users should use [`LookupResult::decode()`](crate::LookupResult::decode)
66-
/// instead of this type directly.
61+
/// Implements serde's `Deserializer` trait. Handles pointer resolution,
62+
/// type coercion, and nested data structures.
6763
#[derive(Debug)]
68-
pub struct Decoder<'de> {
64+
pub(crate) struct Decoder<'de> {
6965
buf: &'de [u8],
7066
current_ptr: usize,
7167
depth: u16,
7268
}
7369

7470
impl<'de> Decoder<'de> {
75-
pub fn new(buf: &'de [u8], start_ptr: usize) -> Decoder<'de> {
71+
pub(crate) fn new(buf: &'de [u8], start_ptr: usize) -> Decoder<'de> {
7672
Decoder {
7773
buf,
7874
current_ptr: start_ptr,
@@ -110,9 +106,8 @@ impl<'de> Decoder<'de> {
110106
MaxMindDbError::decoding_at(msg, self.current_ptr)
111107
}
112108

113-
/// Returns the current offset in the data section.
114109
#[inline]
115-
pub fn offset(&self) -> usize {
110+
pub(crate) fn offset(&self) -> usize {
116111
self.current_ptr
117112
}
118113

0 commit comments

Comments
 (0)