diff --git a/CODE_STYLE.md b/CODE_STYLE.md new file mode 100644 index 00000000..61f860e4 --- /dev/null +++ b/CODE_STYLE.md @@ -0,0 +1,26 @@ +# 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, + T: Into, + P: Into, + E: Into> + (user_id: i32, name: N, title: T, png_sticker: P, emojis: E) -> Self { ... } +``` + +Good: + +```rust + pub fn new(user_id: i32, name: N, title: T, png_sticker: P, emojis: E) -> Self + where + N: Into, + T: Into, + P: Into, + E: Into { ... } +```