From 84c3c4ea47165910c12d7765d172d1b08bd3e732 Mon Sep 17 00:00:00 2001 From: Marcel Schneider Date: Mon, 24 Jun 2019 19:54:00 +0200 Subject: [PATCH] Add snippet for fmt::Display implementation --- vim/neosnippets/rust.snip | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vim/neosnippets/rust.snip b/vim/neosnippets/rust.snip index 02949bd..e359b06 100644 --- a/vim/neosnippets/rust.snip +++ b/vim/neosnippets/rust.snip @@ -2,3 +2,12 @@ snippet debug abbr deb options head println!("{:?}", ${1}); + +snippet impldisplay +abbr disp +options head + impl fmt::Display for ${1} { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "${2}", ${3}) + } + }