learning-rust / learning-rust.github.io

Rust Programming Language Tutorials for Everyone!
https://learning-rust.github.io
MIT License
1.48k stars 165 forks source link

Code blocks for multiple files is confusing #38

Open MichalMichalak opened 4 years ago

MichalMichalak commented 4 years ago

It's just an opinion but, I think, the formula for showing multiple files in one code block makes it really confusing to read. It would be much better for multiple files to use multiple code blocks.

This is what we have now.

// 01. greetings/Cargo.toml to mark as a workspace and to add members
[workspace]
members = [
    "lib",
    "examples/hello"
]

// 02.1 greetings/lib/Cargo.toml to change the package name to greetings
[package]
name = "greetings"
version = "0.1.0"
authors = ["Dumindu Madunuwan"]

[dependencies]

It would be better like this.

greetings/Cargo.toml to mark as a workspace and to add members

[workspace]
members = [
    "lib",
    "examples/hello"
]

greetings/lib/Cargo.toml to change the package name to greetings

[package]
name = "greetings"
version = "0.1.0"
authors = ["Dumindu Madunuwan"]

[dependencies]
ghost commented 2 years ago

I just stumbled upon this website and its very informative, much better than the official book. I agree its hard to know where a file starts and ends. Multiple codeblocks would definitely help.