diff options
Diffstat (limited to '.emacs.d/snippets/rust-mode/fromstr')
| -rw-r--r-- | .emacs.d/snippets/rust-mode/fromstr | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/.emacs.d/snippets/rust-mode/fromstr b/.emacs.d/snippets/rust-mode/fromstr new file mode 100644 index 0000000..891751c --- /dev/null +++ b/.emacs.d/snippets/rust-mode/fromstr | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: impl FromStr for Type { fn from_str(...) } | ||
| 3 | # key: fromstr | ||
| 4 | # -- | ||
| 5 | impl FromStr for ${1:Type} { | ||
| 6 | type Err = ${2:Error}; | ||
| 7 | |||
| 8 | fn from_str(s: &str) -> Result<Self, Self::Err> { | ||
| 9 | Ok(Self{}) | ||
| 10 | } | ||
| 11 | } | ||
