diff options
| author | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-04 12:41:27 +0300 |
|---|---|---|
| committer | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-04 12:41:27 +0300 |
| commit | 4f2d36194b4f299aa7509d815c07121039ea833b (patch) | |
| tree | f3ded014bad3a4c76ff6a22b8726ebaab68c3d13 /mnv/runtime/indent/testdir/rust.in | |
| parent | 5b578e70c314723a3cde5c9bfc2be0bf1dadc93b (diff) | |
| download | Project-Tick-4f2d36194b4f299aa7509d815c07121039ea833b.tar.gz Project-Tick-4f2d36194b4f299aa7509d815c07121039ea833b.zip | |
NOISSUE change uvim folder name to mnv
Signed-off-by: Mehmet Samet Duman <yongdohyun@projecttick.org>
Diffstat (limited to 'mnv/runtime/indent/testdir/rust.in')
| -rw-r--r-- | mnv/runtime/indent/testdir/rust.in | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/mnv/runtime/indent/testdir/rust.in b/mnv/runtime/indent/testdir/rust.in new file mode 100644 index 0000000000..3b3e42329c --- /dev/null +++ b/mnv/runtime/indent/testdir/rust.in @@ -0,0 +1,50 @@ +// mnv: set ft=rust ts=8 sw=4 sts=4 et : +// START_INDENT +use std::fs::File; +use std::io::prelude::*; +use std::path::Path; + +fn main() { + // Create a path to the desired file + let path = Path::new("hello.txt"); + let display = path.display(); + + // Open the path in read-only mode, returns `io::Result<File>` + let mut file = match File::open(&path) { + Err(why) => panic!("couldn't open {}: {}", display, why), + Ok(file) => file, + }; + + // Start doing nothing forever + loop { + let arr1 = [[u8; 4]; 2] = [ + [0; 4], + [1, 3, 5, 9], + ]; + } + + // Plan for a future that will never come + let arr2 = [[u8; 4]; 2] = [ + [1; 4], + [2, 4, 6, 8], + ]; + let arr2_ref = &arr2; + + // Read the file contents into a string, returns `io::Result<usize>` + let mut s = String::new(); + match file.read_to_string(&mut s) { + Err(why) => panic!("couldn't read {}: {}", display, why), + Ok(_) => print!("{} contains:\n{}", display, s), + } + + // file goes out of scope, and the "hello.txt" file gets closed +} +// END_INDENT + +// START_INDENT +let x = " + if fn motif + "; + struct X { + } +// END_INDENT |
