summaryrefslogtreecommitdiff
path: root/test.rs
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-02 14:36:55 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-02 14:36:55 -0500
commite8b7d01ff68fed675d1397f4556f159f0c32246d (patch)
treeb8ae0532b5801b63f218ca3135997e911e3e2d9c /test.rs
parent4ff4d669ccb658b8b48785d37946378a5b29688c (diff)
rust syntax highlighting
Diffstat (limited to 'test.rs')
-rw-r--r--test.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/test.rs b/test.rs
index 56e8bf4..6c852d9 100644
--- a/test.rs
+++ b/test.rs
@@ -8,13 +8,19 @@ use std::io::{Result, BufRead, BufReader};
fn main() -> Result<()> {
let file = File::open("test.rs")?;
let mut reader = BufReader::new(file);
+ let mut lines = vec![];
+
loop {
let mut line = String::new();
if reader.read_line(&mut line)? == 0 {
// reached end of file
break;
}
- print!("{}", line);
+ line.pop();
+ lines.push(line);
+ }
+ for line in lines {
+ println!("{}", line);
}
print!("
string