term_keep 1.2.1

Terminal-based Google Keep clone. Can be used as a note taking / To-Do list app on a server.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use rand::seq::SliceRandom;

static TIPS_FILE: &str = include_str!("../../data/tips.txt");

#[must_use]
pub fn random_tip() -> Option<String> {
  TIPS_FILE
    .split('\n')
    .filter(|line| !line.is_empty())
    .collect::<Vec<&str>>()
    .choose(&mut rand::thread_rng())
    .map(|s| (*s).to_owned())
}