diff --git a/src/bin/poc-daemon/context.rs b/src/bin/poc-daemon/context.rs index d4b4987..ff65a3a 100644 --- a/src/bin/poc-daemon/context.rs +++ b/src/bin/poc-daemon/context.rs @@ -50,7 +50,7 @@ pub fn git_context() -> String { } let ctx = parts.join(" | "); if ctx.len() > 300 { - ctx[..300].to_string() + ctx.chars().take(300).collect() } else { ctx } diff --git a/src/bin/poc-daemon/notify.rs b/src/bin/poc-daemon/notify.rs index adc2520..b91c723 100644 --- a/src/bin/poc-daemon/notify.rs +++ b/src/bin/poc-daemon/notify.rs @@ -169,7 +169,7 @@ impl NotifyState { info!( "notification: type={ntype} urgency={urgency} threshold={threshold} msg={}", - &message[..message.len().min(80)] + message.chars().take(80).collect::() ); self.pending.push(Notification { diff --git a/src/bin/poc-daemon/tmux.rs b/src/bin/poc-daemon/tmux.rs index b85dd4b..afd5417 100644 --- a/src/bin/poc-daemon/tmux.rs +++ b/src/bin/poc-daemon/tmux.rs @@ -32,7 +32,8 @@ pub fn find_claude_pane() -> Option { /// /// Sequence: Escape q C-c C-u (clear input), wait, type message, Enter. pub fn send_prompt(pane: &str, msg: &str) -> bool { - info!("SEND [{pane}]: {}...", &msg[..msg.len().min(100)]); + let preview: String = msg.chars().take(100).collect(); + info!("SEND [{pane}]: {preview}..."); let send = |keys: &[&str]| { Command::new("tmux")