diff options
Diffstat (limited to '.emacs.d/snippets/rust-mode/from')
| -rw-r--r-- | .emacs.d/snippets/rust-mode/from | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/.emacs.d/snippets/rust-mode/from b/.emacs.d/snippets/rust-mode/from new file mode 100644 index 0000000..9e86209 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/from | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: impl From<From> for Type { fn from(...) } | ||
| 3 | # key: from | ||
| 4 | # -- | ||
| 5 | impl From<${1:From}> for ${2:Type} { | ||
| 6 | fn from(source: $1) -> Self { | ||
| 7 | $0 | ||
| 8 | Self { } | ||
| 9 | } | ||
| 10 | } | ||
