Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/pu-cli/src/commands/agent_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::error::CliError;
use crate::output;
use pu_core::protocol::Request;

/// Parse comma-separated tags string into a Vec<String>.
/// Parse comma-separated tags string into a `Vec<String>`.
/// Empty string returns empty vec. Whitespace around each tag is trimmed.
fn parse_tags(tags: &str) -> Vec<String> {
if tags.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion crates/pu-core/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::types::{AgentStatus, WorktreeEntry};

pub const PROTOCOL_VERSION: u32 = 2;

/// Serde helper: encode Vec<u8> as hex in JSON for binary PTY data.
/// Serde helper: encode `Vec<u8>` as hex in JSON for binary PTY data.
mod hex_bytes {
use serde::{Deserialize, Deserializer, Serialize, Serializer};

Expand Down
7 changes: 5 additions & 2 deletions crates/pu-core/src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,10 @@ fn scan_dir(dir: &Path, source: &str) -> Vec<Template> {
let path = entry.path();
if path.extension().and_then(|e| e.to_str()) == Some("md") {
if let Ok(content) = std::fs::read_to_string(&path) {
let file_name = path.file_name().unwrap().to_string_lossy().to_string();
let Some(file_name) = path.file_name() else {
continue;
};
let file_name = file_name.to_string_lossy().to_string();
let mut tpl = parse_template(&content, &file_name);
tpl.source = source.to_string();
templates.push(tpl);
Expand All @@ -247,7 +250,7 @@ fn find_in_dir(dir: &Path, name: &str, source: &str) -> Option<Template> {
let path = dir.join(format!("{name}.md"));
if path.is_file() {
if let Ok(content) = std::fs::read_to_string(&path) {
let file_name = path.file_name().unwrap().to_string_lossy().to_string();
let file_name = path.file_name()?.to_string_lossy().to_string();
let mut tpl = parse_template(&content, &file_name);
tpl.source = source.to_string();
return Some(tpl);
Expand Down
Loading