gitui 0.22.1

blazing fast terminal-ui for git
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use once_cell::sync::Lazy;
use std::borrow::Cow;

static EMOJI_REPLACER: Lazy<gh_emoji::Replacer> =
	Lazy::new(gh_emoji::Replacer::new);

// Replace markdown emojis with Unicode equivalent
// :hammer: --> 🔨
#[inline]
pub fn emojifi_string(s: &mut String) {
	let resulting_cow = EMOJI_REPLACER.replace_all(s);
	if let Cow::Owned(altered_s) = resulting_cow {
		*s = altered_s;
	}
}