Skip to content

Commit

Permalink
improve styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Wandalen committed Mar 13, 2024
1 parent ffac52d commit 968cdff
Show file tree
Hide file tree
Showing 34 changed files with 167 additions and 167 deletions.
4 changes: 2 additions & 2 deletions module/alias/fundamental_data_type/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,13 @@ impl<T: Copy> core::ops::Deref for MySingle< T >
}
impl< T : Copy > From< std::sync::Arc< T > > for MySingle< T >
{
fn from( src : std::sync::Arc<T>) -> Self {
fn from( src : std::sync::Arc< T >) -> Self {
Self( src )
}
}
impl< T : Copy > From< MySingle< T > > for std::sync::Arc< T >
{
fn from(src: MySingle<T>) -> Self
fn from(src: MySingle< T >) -> Self
{
src.0
}
Expand Down
2 changes: 1 addition & 1 deletion module/core/clone_dyn/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub( crate ) mod private
// Explanation for the use of `unsafe`:
// The `unsafe` block is necessary here because we're performing low-level memory manipulations
// that cannot be checked by the Rust compiler for safety. Specifically, we're manually handling
// raw pointers and converting them to and from `Box<T>`, which is considered unsafe as it
// raw pointers and converting them to and from `Box< T >`, which is considered unsafe as it
// bypasses Rust's ownership and borrowing rules. This is done to dynamically clone a boxed
// trait object, which doesn't support cloning through the standard `Clone` trait. The operations
// within this block are carefully crafted to ensure memory safety manually, including proper
Expand Down
2 changes: 1 addition & 1 deletion module/core/former/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub struct UserProfile
{
age : i32,
username : String,
bio_optional : Option<String>, // Fields could be optional
bio_optional : Option< String >, // Fields could be optional
}

let profile = UserProfile::former()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn reflect_hashset_test()

a_id!( reflect( &set ).is_container(), true );
a_id!( reflect( &set ).len(), 3 );
a_id!( reflect( &set ).type_name(), "std::collections::hash::set::HashSet<i32>" );
a_id!( reflect( &set ).type_name(), "std::collections::hash::set::HashSet< i32 >" );
a_id!( reflect( &set ).type_id(), core::any::TypeId::of::< HashSet< i32 > >() );

let expected = vec!
Expand Down
2 changes: 1 addition & 1 deletion module/core/reflect_tools/tests/inc/reflect_vec_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn reflect_vec_test()

a_id!( reflect( &vec ).is_container(), true );
a_id!( reflect( &vec ).len(), 3 );
a_id!( reflect( &vec ).type_name(), "alloc::vec::Vec<i32>" );
a_id!( reflect( &vec ).type_name(), "alloc::vec::Vec< i32 >" );
a_id!( reflect( &vec ).type_id(), core::any::TypeId::of::< Vec< i32 > >() );

let expected = vec!
Expand Down
12 changes: 6 additions & 6 deletions module/core/strs_tools/src/string/parse_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ pub( crate ) mod private
/// Parsed subject of first command.
pub subject : String,
/// All subjects of the commands in request.
pub subjects : Vec<String>,
pub subjects : Vec< String >,
/// Options map of first command.
pub map : HashMap<String, OpType<String>>,
pub map : HashMap<String, OpType< String >>,
/// All options maps of the commands in request.
pub maps : Vec<HashMap<String, OpType<String>>>,
pub maps : Vec<HashMap<String, OpType< String >>>,
}

///
Expand Down Expand Up @@ -299,7 +299,7 @@ pub( crate ) mod private
}

let subject;
let mut map : HashMap<String, OpType<String>> = HashMap::new();
let mut map : HashMap<String, OpType< String >> = HashMap::new();

if map_entries.1.is_some()
{
Expand Down Expand Up @@ -376,7 +376,7 @@ pub( crate ) mod private

/* */

let str_to_vec_maybe = | src : &str | -> Option<Vec<String>>
let str_to_vec_maybe = | src : &str | -> Option<Vec< String >>
{
if !src.starts_with( '[' ) || !src.ends_with( ']' )
{
Expand All @@ -392,7 +392,7 @@ pub( crate ) mod private
.preserving_delimeters( false )
.preserving_quoting( false )
.perform()
.map( | e | String::from( e ).trim().to_owned() ).collect::< Vec<String> >();
.map( | e | String::from( e ).trim().to_owned() ).collect::< Vec< String > >();

Some( splits )
};
Expand Down
6 changes: 3 additions & 3 deletions module/core/strs_tools/tests/inc/parse_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tests_impls!
/* */

let op = parse::OpType::from( vec![ 1, 2 ] );
let got : Vec<isize> = op.into();
let got : Vec< isize > = op.into();
a_id!( got, vec![ 1, 2 ] );

/* */
Expand All @@ -29,14 +29,14 @@ tests_impls!
a_id!( got.unwrap(), 1 );

let op = parse::OpType::from( vec![ 1, 2 ] );
let got : Vec<isize> = op.vector().unwrap();
let got : Vec< isize > = op.vector().unwrap();
a_id!( got, vec![ 1, 2 ] );

let op = parse::OpType::from( 1 );
let got = op.vector();
a_id!( got, None );

let op : parse::OpType<usize> = parse::OpType::from( vec![ 1, 2 ] );
let op : parse::OpType< usize > = parse::OpType::from( vec![ 1, 2 ] );
let got = op.primitive();
a_id!( got, None );
}
Expand Down
4 changes: 2 additions & 2 deletions module/core/type_constructor/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,13 @@ impl<T: Copy> core::ops::Deref for MySingle< T >
}
impl< T : Copy > From< std::sync::Arc< T > > for MySingle< T >
{
fn from( src : std::sync::Arc<T>) -> Self {
fn from( src : std::sync::Arc< T >) -> Self {
Self( src )
}
}
impl< T : Copy > From< MySingle< T > > for std::sync::Arc< T >
{
fn from(src: MySingle<T>) -> Self
fn from(src: MySingle< T >) -> Self
{
src.0
}
Expand Down
4 changes: 2 additions & 2 deletions module/core/type_constructor/src/type_constuctor/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,13 @@ pub( crate ) mod private
/// }
/// impl< T : Copy > From< std::sync::Arc< T > > for MySingle< T >
/// {
/// fn from( src : std::sync::Arc<T>) -> Self {
/// fn from( src : std::sync::Arc< T >) -> Self {
/// Self( src )
/// }
/// }
/// impl< T : Copy > From< MySingle< T > > for std::sync::Arc< T >
/// {
/// fn from(src: MySingle<T>) -> Self
/// fn from(src: MySingle< T >) -> Self
/// {
/// src.0
/// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ error[E0277]: `({integer}, {integer})` is not an iterator
| ^^^ `({integer}, {integer})` is not an iterator
|
= help: the trait `Iterator` is not implemented for `({integer}, {integer})`
= help: the trait `From<Collection>` is implemented for `Bad<T>`
= help: the trait `From< Collection >` is implemented for `Bad< T >`
= note: required for `({integer}, {integer})` to implement `IntoIterator`
note: required for `Bad<_>` to implement `From<({integer}, {integer})>`
note: required for `Bad< _ >` to implement `From<({integer}, {integer})>`
--> tests/dt/type_constructor/many/many_from_tuple_test.rs:5:3
|
5 | types!( many Bad : < T > );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ error[E0119]: conflicting implementations of trait `From<main::Bad>` for type `[
|
= note: this error originates in the derive macro `type_constructor_derive_pair_meta::Pair` which comes from the expansion of the macro `types` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `From<i32>` for type `main::Bad`
error[E0119]: conflicting implementations of trait `From< i32 >` for type `main::Bad`
--> tests/dt/type_constructor/pair/homo_pair_double_difinition_test.rs:5:3
|
5 | / types!
Expand Down Expand Up @@ -169,7 +169,7 @@ error[E0119]: conflicting implementations of trait `type_constructor::From_2<i32
|
= note: this error originates in the derive macro `type_constructor_derive_pair_meta::Pair` which comes from the expansion of the macro `types` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `type_constructor::From_1<i32>` for type `main::Bad`
error[E0119]: conflicting implementations of trait `type_constructor::From_1< i32 >` for type `main::Bad`
--> tests/dt/type_constructor/pair/homo_pair_double_difinition_test.rs:5:3
|
5 | / types!
Expand Down Expand Up @@ -203,7 +203,7 @@ error[E0119]: conflicting implementations of trait `type_constructor::AsTuple<(i
|
= note: this error originates in the derive macro `type_constructor_derive_pair_meta::Pair` which comes from the expansion of the macro `types` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `type_constructor::AsSlice<i32>` for type `main::Bad`
error[E0119]: conflicting implementations of trait `type_constructor::AsSlice< i32 >` for type `main::Bad`
--> tests/dt/type_constructor/pair/homo_pair_double_difinition_test.rs:5:3
|
5 | / types!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ error[E0428]: the name `Bad` is defined multiple times
= note: `Bad` must be defined only once in the type namespace of this block
= note: this error originates in the macro `$crate::_single` which comes from the expansion of the macro `types` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `Deref` for type `main::Bad<_>`
error[E0119]: conflicting implementations of trait `Deref` for type `main::Bad< _ >`
--> tests/dt/type_constructor/single/single_redefinition_test.rs:5:3
|
5 | / types!
Expand All @@ -29,11 +29,11 @@ error[E0119]: conflicting implementations of trait `Deref` for type `main::Bad<_
| | ^
| | |
| |___first implementation here
| conflicting implementation for `main::Bad<_>`
| conflicting implementation for `main::Bad< _ >`
|
= note: this error originates in the macro `$crate::_single` which comes from the expansion of the macro `types` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `DerefMut` for type `main::Bad<_>`
error[E0119]: conflicting implementations of trait `DerefMut` for type `main::Bad< _ >`
--> tests/dt/type_constructor/single/single_redefinition_test.rs:5:3
|
5 | / types!
Expand All @@ -46,11 +46,11 @@ error[E0119]: conflicting implementations of trait `DerefMut` for type `main::Ba
| | ^
| | |
| |___first implementation here
| conflicting implementation for `main::Bad<_>`
| conflicting implementation for `main::Bad< _ >`
|
= note: this error originates in the macro `$crate::_single` which comes from the expansion of the macro `types` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `From<&_>` for type `main::Bad<_>`
error[E0119]: conflicting implementations of trait `From<&_>` for type `main::Bad< _ >`
--> tests/dt/type_constructor/single/single_redefinition_test.rs:5:3
|
5 | / types!
Expand All @@ -63,6 +63,6 @@ error[E0119]: conflicting implementations of trait `From<&_>` for type `main::Ba
| | ^
| | |
| |___first implementation here
| conflicting implementation for `main::Bad<_>`
| conflicting implementation for `main::Bad< _ >`
|
= note: this error originates in the macro `$crate::_single` which comes from the expansion of the macro `types` (in Nightly builds, run with -Z macro-backtrace for more info)
2 changes: 1 addition & 1 deletion module/move/_video_experiment/src/video/encoders/mp4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub( crate ) mod private
/* skip alpha channel */
let data = data.iter().enumerate()
.filter_map( | ( i, v ) | if ( i + 1 ) % 4 == 0 { None } else { Some( *v ) } )
.collect::<Vec<u8>>();
.collect::<Vec< u8 >>();
Some( data )
},
ColorType::Yuv444 =>
Expand Down
2 changes: 1 addition & 1 deletion module/move/deterministic_rand/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ let map: HashMap<_, _> = HashMap::from_iter( [ ( 1, "first" ), ( 2, "second" ),

// Convert the HashMap into an iterator, apply deterministic sorting to the keys,
// and then map each (key, value) pair to just the value.
let keys: Vec<_> = map
let keys: Vec< _ > = map
.into_iter()
.if_determinism_then_sort_by( | ( a, _ ), ( b, _ ) | a.cmp( &b ) )
.map( | e | e.1 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn main()

// Convert the HashMap into an iterator, apply deterministic sorting to the keys,
// and then map each (key, value) pair to just the value.
let _keys: Vec<_> = map
let _keys: Vec< _ > = map
.into_iter()
.if_determinism_then_sort_by( | ( a, _ ), ( b, _ ) | a.cmp( &b ) )
.map( | e | e.1 )
Expand Down
2 changes: 1 addition & 1 deletion module/move/deterministic_rand/src/hrng_deterministic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub( crate ) mod private

/// Get a reference to the current random number generator using a reference counter and mutex.
///
/// Returns a shared `Arc<Mutex<Generator>>`.
/// Returns a shared `Arc<Mutex< Generator >>`.
///
/// ### Example
///
Expand Down
6 changes: 3 additions & 3 deletions module/move/deterministic_rand/src/hrng_non_deterministic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub( crate ) mod private
use crate::*;
use core::{ ops::Deref, ops::DerefMut };

/// Emulates behavior of `Arc<Mutex<ThreadRng>>` for compatibility.
/// Emulates behavior of `Arc<Mutex< ThreadRng >>` for compatibility.

#[ derive( Debug ) ]
pub struct SharedGenerator;
Expand All @@ -29,7 +29,7 @@ pub( crate ) mod private
}
}

/// Emulates behavior of `Arc<Mutex<ThreadRng>>` for compatibility.
/// Emulates behavior of `Arc<Mutex< ThreadRng >>` for compatibility.

#[ derive( Debug) ]
pub struct SharedGeneratorLock;
Expand Down Expand Up @@ -125,7 +125,7 @@ pub( crate ) mod private

/// Get a reference to the current random number generator using a reference counter and mutex.
///
/// Returns a shared `Arc<Mutex<Generator>>`.
/// Returns a shared `Arc<Mutex< Generator >>`.
///
/// ### Example
///
Expand Down
26 changes: 13 additions & 13 deletions module/move/deterministic_rand/tests/basic_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn test_rng_manager()
}
count
} )
.sum::<u64>();
.sum::< u64 >();
let _got_pi = 4. * ( got as f64 ) / ( ( 100 * 1000 ) as f64 );
#[ cfg( not( feature = "no_std" ) ) ]
#[ cfg( feature = "determinism" ) ]
Expand All @@ -48,18 +48,18 @@ fn test_reusability()
let child1 = hrng.child( 0 );
let child1_ref = child1.rng_ref();
let mut rng1 = child1_ref.lock().unwrap();
let got = rng1.gen::<u64>();
let got = rng1.gen::< u64 >();
expected[0] = got;
let got = rng1.gen::<u64>();
let got = rng1.gen::< u64 >();
expected[1] = got;
}
{
let child1 = hrng.child( 0 );
let child1_ref = child1.rng_ref();
let mut rng1 = child1_ref.lock().unwrap();
let got = rng1.gen::<u64>();
let got = rng1.gen::< u64 >();
expected[2] = got;
let got = rng1.gen::<u64>();
let got = rng1.gen::< u64 >();
expected[3] = got;
}
#[ cfg( not( feature = "no_std" ) ) ]
Expand All @@ -73,18 +73,18 @@ fn test_reusability()
let child1 = hrng.child( 0 );
let child1_ref = child1.rng_ref();
let mut rng1 = child1_ref.lock().unwrap();
let got = rng1.gen::<u64>();
let got = rng1.gen::< u64 >();
assert_eq!( got, expected[0] );
let got = rng1.gen::<u64>();
let got = rng1.gen::< u64 >();
assert_eq!( got, expected[1] );
}
{
let child1 = hrng.child( 0 );
let child1_ref = child1.rng_ref();
let mut rng1 = child1_ref.lock().unwrap();
let got = rng1.gen::<u64>();
let got = rng1.gen::< u64 >();
assert_eq!( got, expected[2] );
let got = rng1.gen::<u64>();
let got = rng1.gen::< u64 >();
assert_eq!( got, expected[3] );
}
#[ cfg( feature = "determinism" ) ]
Expand All @@ -109,8 +109,8 @@ fn test_par()
.map( |i| ( i, hrng.child( i ) ) )
.for_each( |( i, child )|
{
let got1 = child.rng_ref().lock().unwrap().gen::<u64>();
let got2 = child.rng_ref().lock().unwrap().gen::<u64>();
let got1 = child.rng_ref().lock().unwrap().gen::< u64 >();
let got2 = child.rng_ref().lock().unwrap().gen::< u64 >();
match i {
1 => *expected.0.lock().unwrap() = ( got1, got2 ),
2 => *expected.1.lock().unwrap() = ( got1, got2 ),
Expand All @@ -124,8 +124,8 @@ fn test_par()
.map( |i| ( i, hrng.child( i ) ) )
.for_each( |( i, child )|
{
let got1 = child.rng_ref().lock().unwrap().gen::<u64>();
let got2 = child.rng_ref().lock().unwrap().gen::<u64>();
let got1 = child.rng_ref().lock().unwrap().gen::< u64 >();
let got2 = child.rng_ref().lock().unwrap().gen::< u64 >();
match i
{
1 => assert_eq!( ( got1, got2 ), *expected.0.lock().unwrap() ),
Expand Down
Loading

0 comments on commit 968cdff

Please sign in to comment.