aboutsummaryrefslogtreecommitdiff
path: root/Emacs/.config/emacs/.config/yasnippet/snippets/rust-mode/fromstr
diff options
context:
space:
mode:
Diffstat (limited to 'Emacs/.config/emacs/.config/yasnippet/snippets/rust-mode/fromstr')
-rw-r--r--Emacs/.config/emacs/.config/yasnippet/snippets/rust-mode/fromstr12
1 files changed, 12 insertions, 0 deletions
diff --git a/Emacs/.config/emacs/.config/yasnippet/snippets/rust-mode/fromstr b/Emacs/.config/emacs/.config/yasnippet/snippets/rust-mode/fromstr
new file mode 100644
index 0000000..db95288
--- /dev/null
+++ b/Emacs/.config/emacs/.config/yasnippet/snippets/rust-mode/fromstr
@@ -0,0 +1,12 @@
+# -*- mode: snippet -*-
+# name: impl FromStr for Type { fn from_str(...) }
+# key: fromstr
+# --
+impl FromStr for ${1:Type} {
+ type Err = ${2:Error};
+
+ fn from_str(s: &str) -> Result<Self, Self::Err> {
+
+ Ok(Self{})
+ }
+}