Skip to content

Commit 62696f5

Browse files
committed
Remove highlighting and syntect
1 parent 41170ce commit 62696f5

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ edition = "2018"
88
clap = "2.32.0"
99
indicatif = "0.9.0"
1010
console = "0.6.2"
11-
syntect = "3.0.2"
1211
notify = "4.0.0"
1312
toml = "0.4.10"
1413
serde = {version = "1.0.10", features = ["derive"]}

default_out.md renamed to default_out.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Thanks for installing `rustlings`!
1+
Thanks for installing Rustlings!
22

3-
## Is this your first time?
3+
Is this your first time?
44

55
Let's make sure you're up to speed:
66
- You have Rust installed, preferably via `rustup`
@@ -9,9 +9,7 @@ Let's make sure you're up to speed:
99
- You have installed Rust language support for your editor
1010
- You have locally installed the `rustlings` command by running:
1111

12-
```sh
1312
cargo install --path .
14-
```
1513

1614
If you've done all of this (or even most of it), congrats! You're ready
1715
to start working with Rust.

src/main.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,9 @@ use notify::DebouncedEvent;
66
use notify::{RecommendedWatcher, RecursiveMode, Watcher};
77
use std::ffi::OsStr;
88
use std::fs;
9-
use std::io::BufRead;
109
use std::path::Path;
1110
use std::sync::mpsc::channel;
1211
use std::time::Duration;
13-
use syntect::easy::HighlightFile;
14-
use syntect::highlighting::{Style, ThemeSet};
15-
use syntect::parsing::SyntaxSet;
16-
use syntect::util::as_24_bit_terminal_escaped;
1712

1813
mod exercise;
1914
mod run;
@@ -35,9 +30,6 @@ fn main() {
3530
)
3631
.get_matches();
3732

38-
let ss = SyntaxSet::load_defaults_newlines();
39-
let ts = ThemeSet::load_defaults();
40-
4133
if None == matches.subcommand_name() {
4234
println!();
4335
println!(r#" welcome to... "#);
@@ -92,13 +84,8 @@ fn main() {
9284
}
9385

9486
if matches.subcommand_name().is_none() {
95-
let mut highlighter =
96-
HighlightFile::new("default_out.md", &ss, &ts.themes["base16-eighties.dark"]).unwrap();
97-
for maybe_line in highlighter.reader.lines() {
98-
let line = maybe_line.unwrap();
99-
let regions: Vec<(Style, &str)> = highlighter.highlight_lines.highlight(&line, &ss);
100-
println!("{}", as_24_bit_terminal_escaped(&regions[..], true));
101-
}
87+
let text = fs::read_to_string("default_out.txt").unwrap();
88+
println!("{}", text);
10289
}
10390

10491
println!("\x1b[0m");

0 commit comments

Comments
 (0)