File tree Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ # -*- mode : snippet -*-
2+ # name : impl Display for Type { fn fmt (...) }
3+ # key : display
4+ # --
5+ impl Display for ${ 1 :Type } {
6+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7+ write!(f, "$0 ")
8+ }
9+ }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 1+ # -*- mode : snippet -*-
2+ # name : Result<Type, failure::Error>
3+ # key : result
4+ # --
5+ Result<${ 1 :Type } , ${ 2 :failure::Error } >
You can’t perform that action at this time.
0 commit comments