mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-01-09 20:03:24 +03:00
Compare commits
No commits in common. "7f73219041fc6659d2e8e944c4e1d0341e323478" and "aedeff8b243bad9205b84a657789b59928bf6524" have entirely different histories.
7f73219041
...
aedeff8b24
8
Cargo.lock
generated
8
Cargo.lock
generated
|
@ -303,9 +303,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashbrown"
|
name = "hashbrown"
|
||||||
version = "0.14.5"
|
version = "0.14.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
|
checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ahash",
|
"ahash",
|
||||||
"allocator-api2",
|
"allocator-api2",
|
||||||
|
@ -649,7 +649,7 @@ checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustlings"
|
name = "rustlings"
|
||||||
version = "6.0.0-beta.6"
|
version = "6.0.0-beta.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"assert_cmd",
|
"assert_cmd",
|
||||||
|
@ -668,7 +668,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustlings-macros"
|
name = "rustlings-macros"
|
||||||
version = "6.0.0-beta.6"
|
version = "6.0.0-beta.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"serde",
|
"serde",
|
||||||
|
|
|
@ -8,7 +8,7 @@ exclude = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "6.0.0-beta.6"
|
version = "6.0.0-beta.5"
|
||||||
authors = [
|
authors = [
|
||||||
"Liv <mokou@fastmail.com>",
|
"Liv <mokou@fastmail.com>",
|
||||||
"Mo Bitar <mo8it@proton.me>",
|
"Mo Bitar <mo8it@proton.me>",
|
||||||
|
@ -50,11 +50,11 @@ include = [
|
||||||
anyhow = "1.0.82"
|
anyhow = "1.0.82"
|
||||||
clap = { version = "4.5.4", features = ["derive"] }
|
clap = { version = "4.5.4", features = ["derive"] }
|
||||||
crossterm = "0.27.0"
|
crossterm = "0.27.0"
|
||||||
hashbrown = "0.14.5"
|
hashbrown = "0.14.3"
|
||||||
notify-debouncer-mini = { version = "0.4.1", default-features = false }
|
notify-debouncer-mini = { version = "0.4.1", default-features = false }
|
||||||
os_pipe = "1.1.5"
|
os_pipe = "1.1.5"
|
||||||
ratatui = { version = "0.26.2", default-features = false, features = ["crossterm"] }
|
ratatui = { version = "0.26.2", default-features = false, features = ["crossterm"] }
|
||||||
rustlings-macros = { path = "rustlings-macros", version = "=6.0.0-beta.6" }
|
rustlings-macros = { path = "rustlings-macros", version = "=6.0.0-beta.5" }
|
||||||
serde_json = "1.0.116"
|
serde_json = "1.0.116"
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
toml_edit.workspace = true
|
toml_edit.workspace = true
|
||||||
|
|
19
README.md
19
README.md
|
@ -35,7 +35,7 @@ The following command will download and compile Rustlings:
|
||||||
<!-- TODO: Remove @6.0.0-beta.x -->
|
<!-- TODO: Remove @6.0.0-beta.x -->
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cargo install rustlings@6.0.0-beta.6
|
cargo install rustlings@6.0.0-beta.5
|
||||||
```
|
```
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
|
@ -44,7 +44,7 @@ cargo install rustlings@6.0.0-beta.6
|
||||||
<!-- TODO: Remove @6.0.0-beta.x -->
|
<!-- TODO: Remove @6.0.0-beta.x -->
|
||||||
|
|
||||||
- Make sure you have the latest Rust version by running `rustup update`
|
- Make sure you have the latest Rust version by running `rustup update`
|
||||||
- Try adding the `--locked` flag: `cargo install rustlings@6.0.0-beta.6 --locked`
|
- Try adding the `--locked` flag: `cargo install rustlings@6.0.0-beta.5 --locked`
|
||||||
- Otherwise, please [report the issue](https://github.com/rust-lang/rustlings/issues/new)
|
- Otherwise, please [report the issue](https://github.com/rust-lang/rustlings/issues/new)
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
@ -64,21 +64,6 @@ cd rustlings/
|
||||||
rustlings
|
rustlings
|
||||||
```
|
```
|
||||||
|
|
||||||
## Working environment
|
|
||||||
|
|
||||||
### Editor
|
|
||||||
|
|
||||||
Our general recommendation is [VS Code](https://code.visualstudio.com/) with the [rust-analyzer plugin](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer).
|
|
||||||
But any editor that supports [rust-analyzer](https://rust-analyzer.github.io/) should be enough for working on the exercises.
|
|
||||||
|
|
||||||
### Terminal
|
|
||||||
|
|
||||||
While working with Rustlings, please use a modern terminal for the best user experience.
|
|
||||||
The default terminal on Linux and Mac should be sufficient.
|
|
||||||
On Windows, we recommend the [Windows Terminal](https://aka.ms/terminal).
|
|
||||||
|
|
||||||
If you use VS Code, the builtin terminal should also be fine.
|
|
||||||
|
|
||||||
## Doing exercises
|
## Doing exercises
|
||||||
|
|
||||||
The exercises are sorted by topic and can be found in the subdirectory `exercises/<topic>`.
|
The exercises are sorted by topic and can be found in the subdirectory `exercises/<topic>`.
|
||||||
|
|
|
@ -69,7 +69,6 @@ pub fn init() -> Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
const GITIGNORE: &[u8] = b".rustlings-state.txt
|
const GITIGNORE: &[u8] = b".rustlings-state.txt
|
||||||
solutions
|
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
target
|
target
|
||||||
.vscode
|
.vscode
|
||||||
|
|
|
@ -42,7 +42,7 @@ pub fn list(app_state: &mut AppState) -> Result<()> {
|
||||||
ui_state.message.clear();
|
ui_state.message.clear();
|
||||||
|
|
||||||
match key.code {
|
match key.code {
|
||||||
KeyCode::Char('q') => break,
|
KeyCode::Esc | KeyCode::Char('q') => break,
|
||||||
KeyCode::Down | KeyCode::Char('j') => ui_state.select_next(),
|
KeyCode::Down | KeyCode::Char('j') => ui_state.select_next(),
|
||||||
KeyCode::Up | KeyCode::Char('k') => ui_state.select_previous(),
|
KeyCode::Up | KeyCode::Char('k') => ui_state.select_previous(),
|
||||||
KeyCode::Home | KeyCode::Char('g') => ui_state.select_first(),
|
KeyCode::Home | KeyCode::Char('g') => ui_state.select_first(),
|
||||||
|
|
|
@ -2,7 +2,7 @@ use anyhow::{Context, Result};
|
||||||
use ratatui::{
|
use ratatui::{
|
||||||
layout::{Constraint, Rect},
|
layout::{Constraint, Rect},
|
||||||
style::{Style, Stylize},
|
style::{Style, Stylize},
|
||||||
text::{Line, Span},
|
text::Span,
|
||||||
widgets::{Block, Borders, HighlightSpacing, Paragraph, Row, Table, TableState},
|
widgets::{Block, Borders, HighlightSpacing, Paragraph, Row, Table, TableState},
|
||||||
Frame,
|
Frame,
|
||||||
};
|
};
|
||||||
|
@ -193,25 +193,11 @@ impl<'a> UiState<'a> {
|
||||||
|
|
||||||
let message = if self.message.is_empty() {
|
let message = if self.message.is_empty() {
|
||||||
// Help footer.
|
// Help footer.
|
||||||
let mut spans = Vec::with_capacity(4);
|
Span::raw(
|
||||||
spans.push(Span::raw(
|
"↓/j ↑/k home/g end/G │ <c>ontinue at │ <r>eset │ filter <d>one/<p>ending │ <q>uit",
|
||||||
"↓/j ↑/k home/g end/G │ <c>ontinue at │ <r>eset │ filter ",
|
)
|
||||||
));
|
|
||||||
match self.filter {
|
|
||||||
Filter::Done => {
|
|
||||||
spans.push("<d>one".underlined().magenta());
|
|
||||||
spans.push(Span::raw("/<p>ending"));
|
|
||||||
}
|
|
||||||
Filter::Pending => {
|
|
||||||
spans.push(Span::raw("<d>one/"));
|
|
||||||
spans.push("<p>ending".underlined().magenta());
|
|
||||||
}
|
|
||||||
Filter::None => spans.push(Span::raw("<d>one/<p>ending")),
|
|
||||||
}
|
|
||||||
spans.push(Span::raw(" │ <q>uit"));
|
|
||||||
Line::from(spans)
|
|
||||||
} else {
|
} else {
|
||||||
Line::from(self.message.as_str().light_blue())
|
self.message.as_str().light_blue()
|
||||||
};
|
};
|
||||||
frame.render_widget(
|
frame.render_widget(
|
||||||
message,
|
message,
|
||||||
|
|
Loading…
Reference in a new issue