rustic builder method snippets

This commit is contained in:
Willem Van den Ende
2022-08-10 22:36:32 +02:00
parent b5eed4b538
commit 550476876a
2 changed files with 22 additions and 0 deletions
@@ -0,0 +1,11 @@
# -*- mode: snippet -*-
# name: builder method with T Clonable
# key: with_attribute_t_clone
# --
pub(crate) fn with_${1:attributename}(&mut self, $1: &${2:Type}) -> &${3:structname} {
self.$1 = $1.clone();
return self;
}
$0