Reduce pub visibility: hippocampus, subconscious internals
hippocampus: cursor navigation, transcript parsing, similarity functions to pub(crate). counters::open() made private. subconscious: all format_* prompts helpers to pub(super), load_defs and keys_to_replay_items made private, consolidate_full_with_progress made private. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
9737641c86
commit
1f873140ae
7 changed files with 20 additions and 20 deletions
|
|
@ -103,7 +103,7 @@ impl<'a> Iterator for JsonlBackwardIter<'a> {
|
|||
/// Scans backward for a user-type message whose content starts with
|
||||
/// "This session is being continued". Returns the byte offset of the
|
||||
/// JSON object's opening brace.
|
||||
pub fn find_last_compaction(data: &[u8]) -> Option<usize> {
|
||||
pub(crate) fn find_last_compaction(data: &[u8]) -> Option<usize> {
|
||||
let marker = b"This session is being continued";
|
||||
|
||||
for obj_bytes in JsonlBackwardIter::new(data) {
|
||||
|
|
@ -135,7 +135,7 @@ pub fn find_last_compaction(data: &[u8]) -> Option<usize> {
|
|||
|
||||
/// Find the byte offset of the last compaction in a transcript file.
|
||||
/// Returns None if the file can't be opened or has no compaction.
|
||||
pub fn find_last_compaction_in_file(path: &str) -> Option<u64> {
|
||||
pub(crate) fn find_last_compaction_in_file(path: &str) -> Option<u64> {
|
||||
if path.is_empty() { return None; }
|
||||
|
||||
let file = fs::File::open(path).ok()?;
|
||||
|
|
@ -147,7 +147,7 @@ pub fn find_last_compaction_in_file(path: &str) -> Option<u64> {
|
|||
}
|
||||
|
||||
/// Mmap a transcript file. Returns (Mmap, File) to keep both alive.
|
||||
pub fn mmap_transcript(path: &str) -> Option<(Mmap, fs::File)> {
|
||||
pub(crate) fn mmap_transcript(path: &str) -> Option<(Mmap, fs::File)> {
|
||||
let file = fs::File::open(path).ok()?;
|
||||
let meta = file.metadata().ok()?;
|
||||
if meta.len() == 0 { return None; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue