我看了https://docs.rs/emojis/0.1.1/emojis/struct.Emoji.html并看到了代码
let thinking = emojis::lookup("").unwrap();
assert_eq!(thinking.shortcode().unwrap(), "thinking");
我很快地翻阅了这些文件。有什么方法来尊重查找过程吗?也就是说,我能从这样的事情中得到一个好的思考角色吗?
let mut s : char = emojis::character_from_shortcode(":thinking:");
发布于 2022-08-03 19:42:01
根据文件页 of emojis
机箱,您可以使用emojis::get_by_shortcode
函数。
pub fn get_by_shortcode(s:&str) ->选项<&‘静态Emoji>
他们举的一个例子是:
let rocket = emojis::get_by_shortcode("rocket").unwrap();
assert_eq!(rocket, "");
https://stackoverflow.com/questions/73226773
复制相似问题