usenet_reborn 0.2.2

Terminal-based Usenet NNTP client written in Rust with ratatui/crossterm.
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::error::Error;
use std::fs;
use std::path::Path;

pub fn load_subscriptions<P: AsRef<Path>>(path: P) -> Result<Vec<String>, Box<dyn Error>> {
    let content = fs::read_to_string(path)?;
    let subs = content
        .lines()
        .map(|line| line.trim().to_string())
        .filter(|s| !s.is_empty())
        .collect();
    Ok(subs)
}