2019-12-09 15:41:19 +01:00
# Code style
This is a description of a coding style that every contributor must follow. Please, read the whole document before you start pushing code.
## Generics
Generics are always written with `where` .
Bad:
```rust
pub fn new< N: Into < String > ,
T: Into< String > ,
P: Into< InputFile > ,
E: Into< String > >
(user_id: i32, name: N, title: T, png_sticker: P, emojis: E) -> Self { ... }
```
Good:
```rust
pub fn new< N , T , P , E > (user_id: i32, name: N, title: T, png_sticker: P, emojis: E) -> Self
where
N: Into< String > ,
T: Into< String > ,
P: Into< InputFile > ,
E: Into< String > { ... }
```
2020-01-08 11:20:20 +01:00
## Comments
2020-01-08 11:20:44 +01:00
Comments must describe what your code does and mustn't describe how your code does it and bla-bla-bla. Be sure that your comments follow the grammar, including punctuation, the first capital letter and so on.
2020-01-08 11:20:20 +01:00
Bad:
```rust
/// this function make request to telegram
pub fn make_request(url: & str) -> String { ... }
```
Good:
```rust
/// This function makes a request to Telegram.
pub fn make_request(url: & str) -> String { ... }
```