add unreachable_pub lint, fix all 17 violations

pub → pub(crate) for SseReader methods (used across child modules).
pub → pub(super) for openai::stream_events, tool definitions, store
helpers. pub → private for normalize_link and differentiate_hub_with_graph
(only used within their own files).

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-02 16:15:32 -04:00
parent af3929cc65
commit b0e852a05f
7 changed files with 15 additions and 15 deletions

View file

@ -309,7 +309,7 @@ pub(crate) struct SseReader {
}
impl SseReader {
pub fn new(ui_tx: &UiSender) -> Self {
pub(crate) fn new(ui_tx: &UiSender) -> Self {
Self {
line_buf: String::new(),
chunk_timeout: Duration::from_secs(120),
@ -343,7 +343,7 @@ impl SseReader {
/// Read the next SSE event from the response stream.
/// Returns Ok(Some(value)) for each parsed data line,
/// Ok(None) when the stream ends or [DONE] is received.
pub async fn next_event(
pub(crate) async fn next_event(
&mut self,
response: &mut reqwest::Response,
) -> Result<Option<serde_json::Value>> {

View file

@ -15,7 +15,7 @@ use super::StreamEvent;
/// Stream SSE events from an OpenAI-compatible endpoint, sending
/// parsed StreamEvents through the channel. The caller (runner)
/// handles routing to the UI.
pub async fn stream_events(
pub(super) async fn stream_events(
client: &Client,
base_url: &str,
api_key: &str,

View file

@ -9,7 +9,7 @@ use anyhow::{Context, Result};
use super::ToolOutput;
use crate::agent::types::ToolDef;
pub fn pause(_args: &serde_json::Value) -> Result<ToolOutput> {
pub(super) fn pause(_args: &serde_json::Value) -> Result<ToolOutput> {
Ok(ToolOutput {
text: "Pausing autonomous behavior. Only user input will wake you.".to_string(),
is_yield: true,
@ -19,7 +19,7 @@ pub fn pause(_args: &serde_json::Value) -> Result<ToolOutput> {
})
}
pub fn switch_model(args: &serde_json::Value) -> Result<ToolOutput> {
pub(super) fn switch_model(args: &serde_json::Value) -> Result<ToolOutput> {
let model = args
.get("model")
.and_then(|v| v.as_str())
@ -36,7 +36,7 @@ pub fn switch_model(args: &serde_json::Value) -> Result<ToolOutput> {
})
}
pub fn yield_to_user(args: &serde_json::Value) -> Result<ToolOutput> {
pub(super) fn yield_to_user(args: &serde_json::Value) -> Result<ToolOutput> {
let msg = args
.get("message")
.and_then(|v| v.as_str())
@ -50,7 +50,7 @@ pub fn yield_to_user(args: &serde_json::Value) -> Result<ToolOutput> {
})
}
pub fn definitions() -> Vec<ToolDef> {
pub(super) fn definitions() -> Vec<ToolDef> {
vec![
ToolDef::new(
"switch_model",

View file

@ -21,7 +21,7 @@ struct Args {
fn default_lines() -> usize { 50 }
pub fn definition() -> ToolDef {
pub(super) fn definition() -> ToolDef {
ToolDef::new(
"view_image",
"View an image file or capture a tmux pane screenshot. \
@ -49,7 +49,7 @@ pub fn definition() -> ToolDef {
}
/// View an image file or capture a tmux pane.
pub fn view_image(args: &serde_json::Value) -> Result<ToolOutput> {
pub(super) fn view_image(args: &serde_json::Value) -> Result<ToolOutput> {
let a: Args = serde_json::from_value(args.clone())
.context("invalid view_image arguments")?;