Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rust FMT #304

Merged
merged 7 commits into from
Nov 2, 2023
Merged

Add Rust FMT #304

merged 7 commits into from
Nov 2, 2023

Conversation

insipx
Copy link
Contributor

@insipx insipx commented Nov 2, 2023

Bunch of big PRs were merged and work seems about to go full steam ahead on MLS, so I figured it a good time to add rustfmt. Option description here. Other popular options are use_small_heuristics/fn_args_layout.

I configured some basic options, mostly w.r.t comments and organizing of module imports. The most controversial is probably module import method, but the 'StdExternalCrate' option should organize things in three groups:

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;

which makes it nice & easy to see whether imports are internal, external, or part of the standard library. I believe it is also aligns with auto-import in rust-analyzer.

@insipx insipx marked this pull request as ready for review November 2, 2023 12:17
@insipx insipx requested review from a team, neekolas and richardhuaaa November 2, 2023 12:17
@insipx
Copy link
Contributor Author

insipx commented Nov 2, 2023

lets hold off on merge until #300

@insipx insipx merged commit 58646ea into main Nov 2, 2023
6 checks passed
@insipx insipx deleted the add-rust-fmt branch November 2, 2023 19:50
@insipx insipx mentioned this pull request Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants