remove mkdocs specific syntax

This commit is contained in:
Marcello 2024-06-16 19:14:59 +02:00
parent 8d08c1964f
commit 8026e1465b
Signed by: m-lamonaca
SSH key fingerprint: SHA256:8db8uii6Gweq7TbKixFBioW2T8CbgtyFETyYL3cr3zk
77 changed files with 1128 additions and 1128 deletions

View file

@ -2,7 +2,7 @@
## Creating a project
```ps1 linenums="1"
```ps1
cargo new project_name # creates project folder and basic files
cargo new --vcs=git project_name # init project as git repo
```
@ -11,7 +11,7 @@ cargo new --vcs=git project_name # init project as git repo
Inside the project directory:
```ps1 linenums="1"
```ps1
cargo build # build project and download eventual needed dependencies
cargo build --release # build project for release (build + optimisations)
cargo run # executes the built executable
@ -22,7 +22,7 @@ cargo check # verifies buildability without producing an executable
In `Cargo.toml`:
```toml linenums="1"
```toml
[dependencies]
crate_name = "<version_number>"
```
@ -70,7 +70,7 @@ A path can take two forms:
Both absolute and relative paths are followed by one or more identifiers separated by double colons (`::`).
```rs linenums="1"
```rs
module::function(); // rel path (same crate)
super::function();; // rel path starting in outer module (same crate)
@ -88,7 +88,7 @@ The way privacy works in Rust is that all items (functions, methods, structs, en
Items in a parent module cant use the private items inside child modules, but items in child modules can use the items in their ancestor modules.
The reason is that child modules wrap and hide their implementation details, but the child modules can see the context in which theyre defined.
```rs linenums="1"
```rs
mod module {
fn func() {}
}
@ -109,7 +109,7 @@ In contrast, if an enum is made public, all of its variants are then public.
### `use`
```rs linenums="1"
```rs
use <crate_name>::module; // import module (abs path, other crate)
use crate::module; // import module (abs path, same crate)
use self::module; // import module (rel path, same crate)
@ -125,7 +125,7 @@ module::function(); // use func w/ shorter path
## Separating into multiple files
```txt linenums="1"
```txt
src
|_main.rs --> default executable file
|_lib.rs --> default library file
@ -134,7 +134,7 @@ src
| |_submodule.rs --> submodule
```
```rs linenums="1"
```rs
// main.rs
mod module; // declare module directory as a module