tododo 0.1.2

A minimal terminal todo manager built with Rust and Ratatui
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::error::AppError;

/// Validates a todo title.
/// Returns the trimmed title if valid, or an error if invalid.
pub fn validate_title(title: &str) -> Result<&str, AppError> {
    let trimmed = title.trim();
    if trimmed.is_empty() {
        return Err(AppError::Validation("Title cannot be empty".into()));
    }
    if trimmed.len() > 100 {
        return Err(AppError::Validation("Title exceeds 100 characters".into()));
    }
    Ok(trimmed)
}