Differences

This shows you the differences between two versions of the page.

Link to this comparison view

snippets:rust:start [2019/11/18 05:12] (current)
spotlightkid Add Rust snippets
Line 1: Line 1:
 +====== Collection of Snippets for Rust ======
 +
 +Just copy the ''​[Rust]''​ section from the code below into your snippets file, e.g. in ''​~/​.config/​geany/​snippets.conf''​.
 +
 +
 +<code properties>​
 +[Rust]
 +enum=enum %cursor% {\n\t%cursor%,​\n}\n
 +fn=fn %cursor%() {\n\t%cursor%\n}\n
 +for=for elem in %cursor% {\n\t%cursor%\n}\n
 +ife=if %cursor% {\n\t%cursor%\n} else {\n\t%cursor%\n}\n
 +if=if %cursor% {\n\t%cursor%\n}\n
 +loop=loop {\n\t%cursor%\n}\n
 +main=fn main() {\n\t%cursor%\n}\n
 +match=let %cursor% = match %cursor% {\n\tOk(%cursor%) => %cursor%,​\n\tErr(_) => {\n\t\tpanic!("​Error:​ {:?}", error)\n\t},​\n};​\n
 +print=println!("​%cursor%{}",​ %cursor%);
 +std=use std::​io%cursor%;​\n
 +while=while %cursor% {\n\t%cursor%\n}\n
 +</​code>​
 +
 +
 +{{tag>​snippet rust}}
  
Print/export