From 18f7f50f59ca8e0e646d8292478f9cde1a024d8b Mon Sep 17 00:00:00 2001 From: Nikita Pekin Date: Fri, 17 Feb 2017 11:10:29 -0500 Subject: [PATCH] style: apply rustfmt to code Update rustfmt configuration. Apply rustfmt to the code. --- rustfmt.toml | 11 +++++++++-- src/lib.rs | 8 ++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/rustfmt.toml b/rustfmt.toml index 134b01f..b28fd79 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,11 +1,18 @@ enum_trailing_comma = true -ideal_width = 80 fn_args_density = "Compressed" +fn_args_layout = "Block" +format_strings = false +ideal_width = 80 match_block_trailing_comma = true +match_wildcard_trailing_comma = true max_width = 99 +normalize_comments = false +reorder_imported_names = true reorder_imports = true report_fixme = "Always" report_todo = "Always" -struct_trailing_comma = "Always" +struct_lit_trailing_comma = "Vertical" +struct_trailing_comma = "Vertical" +where_trailing_comma = true wrap_comments = true write_mode = "Overwrite" diff --git a/src/lib.rs b/src/lib.rs index ee550f7..5744868 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -87,7 +87,7 @@ impl LazyCell { /// Borrows the contents of this lazy cell for the duration of the cell /// itself. - /// + /// /// If the cell has not yet been filled, the cell is first filled using the /// function provided. pub fn borrow_with T>(&self, f: F) -> &T { @@ -165,12 +165,12 @@ impl AtomicLazyCell { } } -unsafe impl Sync for AtomicLazyCell { } -unsafe impl Send for AtomicLazyCell { } +unsafe impl Sync for AtomicLazyCell {} +unsafe impl Send for AtomicLazyCell {} #[cfg(test)] mod tests { - use super::{LazyCell, AtomicLazyCell}; + use super::{AtomicLazyCell, LazyCell}; #[test] fn test_borrow_from_empty() {