my-config/nvim/snippets/rust.json

35 lines
881 B
JSON
Raw Permalink Normal View History

2024-08-20 12:58:27 +00:00
{
"leetcode": {
"prefix": "leetcode",
"body": [
"pub struct Solution;",
"impl Solution {",
" pub fn ${1:name}(${2:arg}: ${3:Type}) -> ${4:RetType} {",
" ${5:todo!();}",
" }",
"}",
"",
"#[cfg(test)]",
"mod tests {",
" use super::Solution;",
"",
" #[test]",
" fn test1() {",
" ${6:todo!();}",
" }",
"",
" #[test]",
" fn test2() {",
" ${7:todo!();}",
" }",
"",
" #[test]",
" fn test3() {",
" ${8:todo!();}",
" }",
"}"
],
"description": "leetcode Solution snippet"
}
}