Regenerate nvim config
This commit is contained in:
@ -0,0 +1,11 @@
|
||||
const X: [i32; 2] = [
|
||||
1,
|
||||
2,
|
||||
];
|
||||
|
||||
fn foo() {
|
||||
let _x = [
|
||||
1,
|
||||
2,
|
||||
];
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
/// Function foo
|
||||
///
|
||||
/// Description of
|
||||
/// function foo.
|
||||
fn foo(x: i32, y: i32) -> i32 {
|
||||
x + y
|
||||
}
|
||||
|
||||
impl A {
|
||||
/// Do some stuff!! (put cursor here and press enter)
|
||||
fn a();
|
||||
}
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
fn foo(mut x: i32) -> i32 {
|
||||
if x > 10 {
|
||||
return 10;
|
||||
} else if x == 10 {
|
||||
return 9;
|
||||
} else {
|
||||
x += 10;
|
||||
}
|
||||
|
||||
if x < 0 {
|
||||
if x == -1 {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
0
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
enum Foo {
|
||||
X,
|
||||
Y(
|
||||
char,
|
||||
char,
|
||||
),
|
||||
Z {
|
||||
x: u32,
|
||||
y: u32,
|
||||
},
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
fn foo() -> i32 {
|
||||
1
|
||||
}
|
||||
|
||||
fn foo(
|
||||
x: i32,
|
||||
y: i32
|
||||
) -> i32 {
|
||||
x + y
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
fn foo() -> i32 {
|
||||
if let Some(v) = Some(2) {
|
||||
1
|
||||
} else {
|
||||
2
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
struct Foo;
|
||||
|
||||
impl Foo {
|
||||
fn foo() -> i32 {
|
||||
1
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
fn foo(mut x: i32) {
|
||||
while x > 0 {
|
||||
x -= 1;
|
||||
}
|
||||
|
||||
for i in 0..3 {
|
||||
x += 1;
|
||||
}
|
||||
|
||||
loop {
|
||||
x += 1;
|
||||
|
||||
if x < 100 {
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
macro_rules! foo {
|
||||
($a:ident, $b:ident, $c:ident) => {
|
||||
struct a { value: $a };
|
||||
struct b { value: $b };
|
||||
};
|
||||
($a:ident) => {
|
||||
struct a { value: $a };
|
||||
};
|
||||
}
|
||||
|
||||
foo! {
|
||||
A
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fn foo(x: i32) -> i32 {
|
||||
match x {
|
||||
0 => 1,
|
||||
1 => {
|
||||
2
|
||||
},
|
||||
2 | 3 => {
|
||||
4
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
mod foo {
|
||||
const X: i32 = 1;
|
||||
|
||||
mod bar {
|
||||
|
||||
const Y: i32 = 1;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
fn foo() {
|
||||
let a = "hello
|
||||
world";
|
||||
|
||||
let b = "hello\
|
||||
world";
|
||||
|
||||
let c = r#"
|
||||
hello
|
||||
world
|
||||
"#;
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
struct Foo {
|
||||
x: u32,
|
||||
y: u32,
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
struct Foo;
|
||||
|
||||
trait Bar {
|
||||
fn bar();
|
||||
}
|
||||
|
||||
impl Bar for Foo {
|
||||
fn bar() {
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
fn foo() {
|
||||
for (
|
||||
a,
|
||||
b
|
||||
) in c.iter() {
|
||||
// ...
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
fn foo<T>(t: T) -> i32
|
||||
where
|
||||
T: Debug,
|
||||
{
|
||||
1
|
||||
}
|
||||
|
||||
fn foo<T>(t: T) -> i32 where
|
||||
T: Debug,
|
||||
{
|
||||
1
|
||||
}
|
||||
|
||||
struct Foo<T>(T);
|
||||
|
||||
impl<T> Write for Foo<T>
|
||||
where
|
||||
T: Debug,
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user