mirror of
https://github.com/openharmony/third_party_rust_lazycell.git
synced 2026-06-30 21:08:03 -04:00
style: apply rustfmt to code
Update rustfmt configuration. Apply rustfmt to the code.
This commit is contained in:
+9
-2
@@ -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"
|
||||
|
||||
+4
-4
@@ -87,7 +87,7 @@ impl<T> LazyCell<T> {
|
||||
|
||||
/// 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<F: FnOnce() -> T>(&self, f: F) -> &T {
|
||||
@@ -165,12 +165,12 @@ impl<T> AtomicLazyCell<T> {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<T: Sync> Sync for AtomicLazyCell<T> { }
|
||||
unsafe impl<T: Send> Send for AtomicLazyCell<T> { }
|
||||
unsafe impl<T: Sync> Sync for AtomicLazyCell<T> {}
|
||||
unsafe impl<T: Send> Send for AtomicLazyCell<T> {}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::{LazyCell, AtomicLazyCell};
|
||||
use super::{AtomicLazyCell, LazyCell};
|
||||
|
||||
#[test]
|
||||
fn test_borrow_from_empty() {
|
||||
|
||||
Reference in New Issue
Block a user