Avoid ending punctuation in short list items

Former-commit-id: d0add19b29
This commit is contained in:
Hirrolot 2022-08-20 16:16:08 +06:00
parent fe10cbce67
commit 0808ec34be
3 changed files with 39 additions and 15 deletions

View file

@ -42,7 +42,31 @@ Good:
pub fn make_request(url: &str) -> String { ... } pub fn make_request(url: &str) -> String { ... }
``` ```
2. Also, link resources in your comments when possible: 2. Do not use ending punctuation in short list items (usually containing just one phrase or sentence). Bad:
```md
- Handle different kinds of Update.
- Pass dependencies to handlers.
- Disable a default Ctrl-C handling.
```
Bad:
```md
- Handle different kinds of Update;
- Pass dependencies to handlers;
- Disable a default Ctrl-C handling.
```
Good:
```md
- Handle different kinds of Update
- Pass dependencies to handlers
- Disable a default Ctrl-C handling
```
3. Link resources in your comments when possible:
```rust ```rust
/// Download a file from Telegram. /// Download a file from Telegram.

View file

@ -153,12 +153,12 @@
//! </details> //! </details>
//! //!
//! Each parameter is supplied as a dependency by teloxide. In particular: //! Each parameter is supplied as a dependency by teloxide. In particular:
//! - `bot: AutoSend<Bot>` comes from the dispatcher (see below); //! - `bot: AutoSend<Bot>` comes from the dispatcher (see below)
//! - `msg: Message` comes from [`Update::filter_message`]; //! - `msg: Message` comes from [`Update::filter_message`]
//! - `q: CallbackQuery` comes from [`Update::filter_callback_query`]; //! - `q: CallbackQuery` comes from [`Update::filter_callback_query`]
//! - `dialogue: MyDialogue` comes from [`dialogue::enter`]; //! - `dialogue: MyDialogue` comes from [`dialogue::enter`]
//! - `full_name: String` comes from `dptree::case![State::ReceiveProductChoice //! - `full_name: String` comes from `dptree::case![State::ReceiveProductChoice
//! { full_name }]`. //! { full_name }]`
//! //!
//! Inside `main`, we plug the schema into [`Dispatcher`] like this: //! Inside `main`, we plug the schema into [`Dispatcher`] like this:
//! //!
@ -199,13 +199,13 @@
//! bit more complicated setup. //! bit more complicated setup.
//! //!
//! Here are things that dispatching can do, but REPLs can't: //! Here are things that dispatching can do, but REPLs can't:
//! - Handle different kinds of [`Update`]; //! - Handle different kinds of [`Update`]
//! - [Pass dependencies] to handlers; //! - [Pass dependencies] to handlers
//! - Disable a [default Ctrl-C handling]; //! - Disable a [default Ctrl-C handling]
//! - Control your [default] and [error] handlers; //! - Control your [default] and [error] handlers
//! - Use [dialogues]. //! - Use [dialogues]
//! - Use [`dptree`]-related functionality. //! - Use [`dptree`]-related functionality
//! - Probably more. //! - Probably more
//! //!
//! Thus, REPLs are good for simple bots and rapid prototyping, but for more //! Thus, REPLs are good for simple bots and rapid prototyping, but for more
//! involved scenarios, we recommend using dispatching over REPLs. //! involved scenarios, we recommend using dispatching over REPLs.

View file

@ -29,7 +29,7 @@ use teloxide_core::requests::Requester;
/// ///
/// ## Dependency requirements /// ## Dependency requirements
/// ///
/// - Those of [`HandlerExt::filter_command`]. /// - Those of [`HandlerExt::filter_command`]
/// ///
/// [REPL]: https://en.wikipedia.org/wiki/Read-eval-print_loop /// [REPL]: https://en.wikipedia.org/wiki/Read-eval-print_loop
/// [`Dispatcher`]: crate::dispatching::Dispatcher /// [`Dispatcher`]: crate::dispatching::Dispatcher
@ -72,7 +72,7 @@ where
/// ///
/// ## Dependency requirements /// ## Dependency requirements
/// ///
/// - Those of [`HandlerExt::filter_command`]. /// - Those of [`HandlerExt::filter_command`]
/// ///
/// [`Dispatcher`]: crate::dispatching::Dispatcher /// [`Dispatcher`]: crate::dispatching::Dispatcher
/// [`commands_repl`]: crate::dispatching::repls::commands_repl() /// [`commands_repl`]: crate::dispatching::repls::commands_repl()