diff --git a/doc/en/dev/conventions-git.md b/doc/en/dev/conventions-git.md index f5b319b3a599df9c294dc9e27cab4516c49600dc..a917a7120d9d5b9067bc8d9f01f4313fa1ec3f67 100644 --- a/doc/en/dev/conventions-git.md +++ b/doc/en/dev/conventions-git.md @@ -5,7 +5,7 @@ ### Branch created by Gitlab Most of the time, you'll use the "create a merge request" button and -Gitlab will name your branche. In that case, please prefix the name of +Gitlab will name your branch. In that case, please prefix the name of your branch with your Gitlab username and a slash, for example: elois/issue-test diff --git a/doc/en/dev/developing-a-durs-module.md b/doc/en/dev/developing-a-durs-module.md index 3f41027c42b9cda38a18c161409feb118e5b1802..cf3c41e6cecc27f62c82f0dfc66c5fb6eb3690c8 100644 --- a/doc/en/dev/developing-a-durs-module.md +++ b/doc/en/dev/developing-a-durs-module.md @@ -20,7 +20,7 @@ A Durs module is a library crate. You must then create your crate in the `lib/` The `lib/` directory has 4 sub-directories which correspond to 4 types of libraries: -1. `tools`: utilities, that could be useful to all crates. +1. `tools`: utilities that could be useful to all crates. 2. `modules`: libraries forming a Durs module. 3. `modules-lib`: libraries dedicated to a subset of modules. 4. `core`: libraries structuring the architecture, linking modules between them. @@ -32,7 +32,8 @@ For example: you create a new module named "toto". You put the crate, which cont ### How to split a module in several crates -If you want to decouple your module in several crates, the directory of your main crate* must be `lib/modules/{your-module-name}/{your-module-name}`. The additional crates must be in `modules/{your-module-name}/{crate-name}`, where `crate-name` must be prefixed by `{your-module-name}`. +If you want to decouple your module in several crates, the directory of your main crate must be `lib/modules/{your-module-name}/{your-module-name}`. +The additional crates must be in `modules/{your-module-name}/{crate-name}`, where `crate-name` must be prefixed by `{your-module-name}`. For example: you want to move some of your "toto" code into a new "tata" crate. You must move `toto` into `lib/modules/toto/toto` and create the tata module into `lib/modules/toto/toto-tata`. In addition, your new crate must declare, into its `Cargo.toml`, the name `durs-toto-tata`. @@ -44,7 +45,7 @@ If you want to write a library to be used by several modules and by them only, y The `tools/` directory must only contain libraries that are also use by the core. -Summing up: +Summary: * if a library is used by the core and maybe by some modules: into `tools/`. * if it is used only by modules: into `modules-common/`. diff --git a/doc/en/dev/setup-your-dev-environment.md b/doc/en/dev/setup-your-dev-environment.md index 981f5e2304a0147b24eadc5da971118781a4187d..4387ff136bbaa064191770be02a240ce05450447 100644 --- a/doc/en/dev/setup-your-dev-environment.md +++ b/doc/en/dev/setup-your-dev-environment.md @@ -115,7 +115,7 @@ Although this is becoming increasingly rare, some rust crates still depend on C/ cd hello-world cargo init --bin -The `--bin' option indicates that you want to create a binary, by default cargo create a library project. +The `--bin` option indicates that you want to create a binary, by default cargo create a library project. You should have the following content in the `hello-world` folder: @@ -128,27 +128,25 @@ You should have the following content in the `hello-world` folder: This is the minimum content of any binary project, the source code is found in `main.rs`. Any Rust project (binary or library) must contain a file named `Cargo.toml` at the root of the project, it is somehow the equivalent of the `package.json` of npm. -The `main.rs` file already contains by default a code to perform the traditional "Hello, world ! : +The `main.rs` file already contains by default a code to perform the traditional "Hello, world !": fn main() { println!("Hello, world!"); } -Cette syntaxe doit vous rappeler furieusement le C/C++ pour ceux qui connaissent, et c'est bien normal car Rust est conçu pour être l'un des successeurs potentiel du C++. On peut toutefois déjà noter trois différences majeures avec le C/C++ : - This syntax must remind you furiously of C/C++ for those who know it, and that's normal because Rust is designed to be one of the potential successors of C++. However, three major differences can already be noted with C/C++ : 1. The main() function does not take any input parameters. Command line arguments are captured in a different way using the standard library. 2. println! is not a function, it's a macro. In Rust all macros are of the form `macro_name!(params)`, so it is to `!` that they are recognized. So why a macro just to print a string? Well because in Rust any function must have a finite number of parameters and each parameter must have an explicitly defined type. To exceed this limit we use a macro that will create the desired function during compilation. 3. The main() function doesn't return any value, when your program ends, Rust sends by default the EXIT_SUCCESS code to the OS. To interrupt your program by sending another exit code, there are macro such as `panic!(err_message)`. -Before changing the code, make sure that the default code compiles correctly : +Before changing the code, make sure that the default code compiles correctly: $ cargo build Compiling hello-world v0.1.0 (file:///home/elois/dev/hello-world) Finished dev [unoptimized + debuginfo] target(s) in 0.91 secs -Cargo is the equivalent of npm for Rust, it will look for all the dependencies of the crates (=libraries) you install. Yes in Rust we speak of crates to designate an addiction, it can be a library or a package. +Cargo is the equivalent of npm for Rust, it will look for all the dependencies of the crates you install. In Rust a "crate" refers to any library or package. It's comparable to Python wheels, Java archive, Ruby gems... If you get a `Finished dev[unoptimized + debuginfo] target(s) in x.xx secs`, congratulations you just compiled your first Rust program :)