Add a bunch of clippings!
This commit is contained in:
1
Contents/Clippings/Rust.rs/Debug println
Normal file
1
Contents/Clippings/Rust.rs/Debug println
Normal file
@@ -0,0 +1 @@
|
|||||||
|
println!("{:?}", #placeholderstart##placeholderend#);
|
||||||
1
Contents/Clippings/Rust.rs/Derive attribute
Normal file
1
Contents/Clippings/Rust.rs/Derive attribute
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#[derive(#placeholderstart#...#placeholderend#)]
|
||||||
3
Contents/Clippings/Rust.rs/Main function
Normal file
3
Contents/Clippings/Rust.rs/Main function
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#indent#fn main() {
|
||||||
|
#placeholderstart#...#placeholderend#
|
||||||
|
}
|
||||||
6
Contents/Clippings/Rust.rs/Read lines from stdin
Normal file
6
Contents/Clippings/Rust.rs/Read lines from stdin
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#INDENT#let stdin = io::stdin();
|
||||||
|
|
||||||
|
for line in stdin.lock().lines() {
|
||||||
|
let line = line.unwrap();
|
||||||
|
#PLACEHOLDERSTART#...#PLACEHOLDEREND#
|
||||||
|
}
|
||||||
4
Contents/Clippings/Rust.rs/Test function
Normal file
4
Contents/Clippings/Rust.rs/Test function
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
\#[test]
|
||||||
|
#indent#fn #placeholderstart#test#placeholderend#() {
|
||||||
|
#placeholderstart#...#placeholderend#
|
||||||
|
}
|
||||||
8
Contents/Clippings/Rust.rs/Test macro
Normal file
8
Contents/Clippings/Rust.rs/Test macro
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#indent#macro_rules! #placeholderstart#name#placeholderend# {
|
||||||
|
($name: ident: $input: expr => $result: expr) => {
|
||||||
|
#[test]
|
||||||
|
fn $name() {
|
||||||
|
assert_eq!($input, $result)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
9
Contents/Clippings/Rust.rs/Test module
Normal file
9
Contents/Clippings/Rust.rs/Test module
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#indent#\#[cfg(test)]
|
||||||
|
mod test {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
\#[test]
|
||||||
|
fn #placeholderstart#test#placeholderend#() {
|
||||||
|
#placeholderstart#...#placeholderend#
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Contents/Clippings/Rust.rs/if let Some()
Normal file
3
Contents/Clippings/Rust.rs/if let Some()
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#indent#if let Some(#placeholderstart#variable#placeholderend#) = #placeholderstart#...#placeholderend# {
|
||||||
|
#placeholderstart#...#placeholderend#
|
||||||
|
}
|
||||||
4
Contents/Clippings/Rust.rs/match Option
Normal file
4
Contents/Clippings/Rust.rs/match Option
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#indent#match #placeholderstart#...#placeholderend# {
|
||||||
|
Some(#placeholderstart#...#placeholderend#) => #placeholderstart#...#placeholderend#,
|
||||||
|
None => #placeholderstart#...#placeholderend#,
|
||||||
|
}
|
||||||
4
Contents/Clippings/Rust.rs/match Result
Normal file
4
Contents/Clippings/Rust.rs/match Result
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#indent#match #placeholderstart#...#placeholderend# {
|
||||||
|
Ok(#placeholderstart#...#placeholderend#) => #placeholderstart#...#placeholderend#,
|
||||||
|
Err(#placeholderstart#...#placeholderend#) => #placeholderstart#...#placeholderend#,
|
||||||
|
}
|
||||||
@@ -13,6 +13,7 @@ This is a BBEdit 11 Package for [Rust](http://www.rust-lang.org). It provides th
|
|||||||
- Go to named symbol
|
- Go to named symbol
|
||||||
- Indexed function menu
|
- Indexed function menu
|
||||||
- Code folding
|
- Code folding
|
||||||
|
- Clippings
|
||||||
|
|
||||||
By default, it highlights anything beginning with a capital letter in a certain colour. To turn this off, just change the Identifier colour to be the same as the default text colour in Preferences.
|
By default, it highlights anything beginning with a capital letter in a certain colour. To turn this off, just change the Identifier colour to be the same as the default text colour in Preferences.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user