-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,22 @@ | ||
# Imports | ||
|
||
- In `*.rs` files, imports should be split into 3 groups [src](https://github.com/rust-dev-tools/fmt-rfcs/issues/131) and separated by a single line. Within a single group, imported items should be sorted alphabetically. | ||
- Imports from `'std'` | ||
- Imports from external crates | ||
- Imports from crates within trin | ||
- In `*.rs` files, imports should be split into 3 groups [src](https://rust-lang.github.io/rustfmt/?version=v1.6.0&search=#StdExternalCrate) and separated by a single line. Within a single group, imported items should be sorted alphabetically. | ||
1. std, core and alloc, | ||
2. external crates, | ||
3. self, super and crate imports. | ||
- Alphabetize imports in `Cargo.toml` | ||
|
||
```rust | ||
use alloc::alloc::Layout; | ||
use core::f32; | ||
use std::sync::Arc; | ||
|
||
use broker::database::PooledConnection; | ||
use chrono::Utc; | ||
use juniper::{FieldError, FieldResult}; | ||
use uuid::Uuid; | ||
|
||
use super::schema::{Context, Payload}; | ||
use super::update::convert_publish_payload; | ||
use crate::models::Event; | ||
``` |