Skip to content
Myr

token.rs

This file

Path

src/exec/token.rs

29 lines · 882 bytes · Rust

Last changed by

Fix clippy suggestionsDavid Peterbefore adoption9ea882d

History of this file

Take it

The walk stopped after 200 commits: lines older than 2570fbd point at it.

Add longer help text for --prune, closes #727David Peterbefore adoption2570fbd

lines 1–6why, one step back
1use std::fmt::{self, Display, Formatter};
23/// Designates what should be written to a buffer4///5/// Each `Token` contains either text, or a placeholder variant, which will be used to generate6/// commands after all tokens for a given command template have been collected.

Fix clippy suggestionsDavid Peterbefore adoption9ea882d

line 7why, one step back
7#[derive(Clone, Debug, PartialEq, Eq)]

Add longer help text for --prune, closes #727David Peterbefore adoption2570fbd

lines 8–29why, one step back
8pub enum Token {
9 Placeholder,10 Basename,11 Parent,12 NoExt,13 BasenameNoExt,14 Text(String),15}1617impl Display for Token {18 fn fmt(&self, f: &mut Formatter) -> fmt::Result {19 match *self {20 Token::Placeholder => f.write_str("{}")?,21 Token::Basename => f.write_str("{/}")?,22 Token::Parent => f.write_str("{//}")?,23 Token::NoExt => f.write_str("{.}")?,24 Token::BasenameNoExt => f.write_str("{/.}")?,25 Token::Text(ref string) => f.write_str(string)?,26 }27 Ok(())28 }29}