Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 1019 Bytes

File metadata and controls

57 lines (41 loc) · 1019 Bytes

Style

Architecture

Individual data processing components should typically only do one thing: taking a single input stream, transforming it and producing an output stream. Should a data format boundary need to be crossed (e.g. file loading or saving) this should be done by a dedicated utility.

Code

In general whatever treefmt (and it's downstream formatters) dictates the code style to use.

In cases where the formatter does not care, the following rules apply:

🦀 No empty lines in use statements

use crate::Something;
use super::SomethingElse
use std::time::Duration
use supermusr_common::Time
use tokio::task::JoinHandle;

instead of

use crate::Something;

use tokio::task::JoinHandle;
use supermusr_common::Time

use std::time::Duration
use super::SomethingElse

🦀 One empty line between fn, impl, and mod block

fn one() -> i32 {
  1
}

fn two() -> i32 {
  1
}

instead of

fn one() -> i32 {
  1
}
fn two() -> i32 {
  1
}