Skip to content

Commit

Permalink
AUTO : Forward from derives_refactoring_8 to alpha (#1404)
Browse files Browse the repository at this point in the history
global refactoring
  • Loading branch information
wtools-bot authored Jul 4, 2024
1 parent 28865e4 commit aa944d8
Show file tree
Hide file tree
Showing 72 changed files with 103 additions and 285 deletions.
1 change: 0 additions & 1 deletion module/alias/instance_of/src/typing/implements_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ pub mod prelude
{
use super::*;
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use private::
{
implements,
Expand Down
1 change: 0 additions & 1 deletion module/alias/instance_of/src/typing/is_slice_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ pub mod prelude
{
use super::*;
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use private::
{
is_slice,
Expand Down
35 changes: 18 additions & 17 deletions module/core/clone_dyn/tests/inc/parametrized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,24 @@ where

//

#[ derive( Debug, Clone ) ]
struct Struct1< T1, T2 >
where
T1 : ::core::fmt::Debug,
T2 : ::core::fmt::Debug,
{
a : T1,
b : T2,
}

impl Trait1< i32, char > for Struct1< i32, char >
{
fn dbg( &self ) -> String
{
format!( "{self:?}( {:?} {:?} )", self.a, self.b )
}
}
// xxx : review
// #[ derive( Debug, Clone ) ]
// struct Struct1< T1, T2 >
// where
// T1 : ::core::fmt::Debug,
// T2 : ::core::fmt::Debug,
// {
// a : T1,
// b : T2,
// }
//
// impl Trait1< i32, char > for Struct1< i32, char >
// {
// fn dbg( &self ) -> String
// {
// format!( "{self:?}( {:?} {:?} )", self.a, self.b )
// }
// }

//

Expand Down
1 change: 0 additions & 1 deletion module/core/clone_dyn_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ pub mod prelude
{
use super::*;
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use private::
{
CloneDyn,
Expand Down
2 changes: 1 addition & 1 deletion module/core/derive_tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ derive_from_str = [ "parse-display", "parse-display/std", "parse-display/regex"

derive_strum = [ "strum/std", "strum/derive", "strum/strum_macros" ]
strum_phf = [ "strum/std", "strum/phf", "strum/strum_macros" ]
# zzz : review features
# zzz : qqq : review features

derive_clone_dyn = [ "clone_dyn/enabled" ]
# derive_clone_dyn_use_std = [ "derive_clone_dyn", "clone_dyn/use_std" ]
Expand Down
6 changes: 0 additions & 6 deletions module/core/derive_tools/tests/inc/basic_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ tests_impls!
let exp = ( 1, 3 );
a_id!( got, exp );

// let src = Struct1 { a : 1, b : 3 };
// let got : [ i32 ; 2 ] = src.into();
// let exp = ( 1, 3 );
// a_id!( got, exp );
/* zzz : make it working */

let src = Struct1 { a : 1, b : 3 };
let got = format!( "{}", src );
let exp = "1-3";
Expand Down
1 change: 0 additions & 1 deletion module/core/derive_tools/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ use test_tools::exposed::*;

#[ cfg( feature = "enabled" ) ]
mod inc;

1 change: 1 addition & 0 deletions module/core/derive_tools_meta/src/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#[ allow( unused_imports ) ]
use macro_tools::prelude::*;
#[ allow( unused_imports ) ]
pub use iter_tools as iter;

#[ cfg( feature = "derive_as_mut" ) ]
Expand Down
1 change: 0 additions & 1 deletion module/core/diagnostics_tools/src/diag/cta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ pub mod prelude
{
use super::*;
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use private::
{
cta_true,
Expand Down
1 change: 0 additions & 1 deletion module/core/diagnostics_tools/src/diag/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ pub mod prelude
use super::*;
#[ cfg( feature = "diagnostics_compiletime_assertions" ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use private::
{
cta_type_same_size,
Expand Down
1 change: 0 additions & 1 deletion module/core/diagnostics_tools/src/diag/rta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ pub mod prelude
pub use private::a_not_id;

#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use private::
{
a_true,
Expand Down
1 change: 0 additions & 1 deletion module/core/format_tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ workspace = true
features = [ "full" ]
all-features = false


[features]

default = [
Expand Down
86 changes: 1 addition & 85 deletions module/core/format_tools/src/format/as_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ pub( crate ) mod private
::core::marker::PhantomData< ( &'a (), fn () -> ( RowKey, Row, CellKey, Cell, Title ) ) >,
)
where
// T : TableRows< 'a, RowKey, Row, CellKey, Cell >,
// T : TableHeader< 'a, CellKey, Title >,
// T : TableSize< 'a >,
Row : Clone + for< 'cell > Cells< 'cell, CellKey, Cell > + 'a,
Title : fmt::Debug,
Cell : fmt::Debug + Clone + 'a,
Expand All @@ -31,9 +28,6 @@ pub( crate ) mod private

impl< 'a, T, RowKey, Row, CellKey, Cell, Title > AsTable< 'a, T, RowKey, Row, CellKey, Cell, Title >
where
// T : TableRows< 'a, RowKey, Row, CellKey, Cell >,
// T : TableHeader< 'a, CellKey, Title >,
// T : TableSize< 'a >,
Row : Clone + for< 'cell > Cells< 'cell, CellKey, Cell > + 'a,
Title : fmt::Debug,
Cell : fmt::Debug + Clone + 'a,
Expand All @@ -48,9 +42,6 @@ pub( crate ) mod private

impl< 'a, T, RowKey, Row, CellKey, Cell, Title > AsRef< T > for AsTable< 'a, T, RowKey, Row, CellKey, Cell, Title >
where
// T : TableRows< 'a, RowKey, Row, CellKey, Cell >,
// T : TableHeader< 'a, CellKey, Title >,
// T : TableSize< 'a >,
Row : Clone + for< 'cell > Cells< 'cell, CellKey, Cell > + 'a,
Title : fmt::Debug,
Cell : fmt::Debug + Clone + 'a,
Expand All @@ -62,28 +53,8 @@ pub( crate ) mod private
}
}

// impl< 'a, T, RowKey, Row, CellKey, Cell, Title > AsMut< T >
// for AsTable< 'a, T, RowKey, Row, CellKey, Cell, Title >
// where
// // T : TableRows< 'a, RowKey, Row, CellKey, Cell >,
// // T : TableHeader< 'a, CellKey, Title >,
// // T : TableSize< 'a >,
// Row : Clone + for< 'cell > Cells< 'cell, CellKey, Cell > + 'a,
// Title : fmt::Debug,
// Cell : fmt::Debug + Clone + 'a,
// CellKey : fmt::Debug + Clone,
// {
// fn as_mut( &mut self ) -> &mut T
// {
// &mut self.0
// }
// }

impl< 'a, T, RowKey, Row, CellKey, Cell, Title > Deref for AsTable< 'a, T, RowKey, Row, CellKey, Cell, Title >
where
// T : TableRows< 'a, RowKey, Row, CellKey, Cell >,
// T : TableHeader< 'a, CellKey, Title >,
// T : TableSize< 'a >,
Row : Clone + for< 'cell > Cells< 'cell, CellKey, Cell > + 'a,
Title : fmt::Debug,
Cell : fmt::Debug + Clone + 'a,
Expand All @@ -97,29 +68,9 @@ pub( crate ) mod private
}
}

// impl< 'a, T, RowKey, Row, CellKey, Cell, Title > DerefMut
// for AsTable< 'a, T, RowKey, Row, CellKey, Cell, Title >
// where
// // T : TableRows< 'a, RowKey, Row, CellKey, Cell >,
// // T : TableHeader< 'a, CellKey, Title >,
// // T : TableSize< 'a >,
// Row : Clone + for< 'cell > Cells< 'cell, CellKey, Cell > + 'a,
// Title : fmt::Debug,
// Cell : fmt::Debug + Clone + 'a,
// CellKey : fmt::Debug + Clone,
// {
// fn deref_mut( &mut self ) -> &mut Self::Target
// {
// &mut self.0
// }
// }

impl< 'a, T, RowKey, Row, CellKey, Cell, Title > From< &'a T >
for AsTable< 'a, T, RowKey, Row, CellKey, Cell, Title >
where
// T : TableRows< 'a, RowKey, Row, CellKey, Cell >,
// T : TableHeader< 'a, CellKey, Title >,
// T : TableSize< 'a >,
Row : Clone + for< 'cell > Cells< 'cell, CellKey, Cell > + 'a,
Title : fmt::Debug,
Cell : fmt::Debug + Clone + 'a,
Expand All @@ -131,44 +82,9 @@ pub( crate ) mod private
}
}

// impl< 'a, T, RowKey, Row, CellKey, Cell, Title > From< AsTable< 'a, T, RowKey, Row, CellKey, Cell, Title > >
// for &'a T
// where
// Row : Clone + for< 'cell > Cells< 'cell, CellKey, Cell > + 'a,
// Title : fmt::Debug,
// Cell : fmt::Debug + Clone + 'a,
// CellKey : fmt::Debug + Clone,
// {
// fn from( wrapper : AsTable< 'a, T, RowKey, Row, CellKey, Cell, Title > ) -> &'a T
// {
// wrapper.0
// }
// }

// impl< 'a, T, RowKey, Row, CellKey, Cell, Title > Default
// for AsTable< 'a, T, RowKey, Row, CellKey, Cell, Title >
// where
// T : Default,
// // T : TableRows< 'a, RowKey, Row, CellKey, Cell >,
// // T : TableHeader< 'a, CellKey, Title >,
// // T : TableSize< 'a >,
// Row : Clone + for< 'cell > Cells< 'cell, CellKey, Cell > + 'a,
// Title : fmt::Debug,
// Cell : fmt::Debug + Clone + 'a,
// CellKey : fmt::Debug + Clone,
// {
// fn default() -> Self
// {
// AsTable( T::default(), PhantomData )
// }
// }

impl< 'a, T, RowKey, Row, CellKey, Cell, Title > fmt::Debug for AsTable< 'a, T, RowKey, Row, CellKey, Cell, Title >
where
T : fmt::Debug,
// T : TableRows< 'a, RowKey, Row, CellKey, Cell >,
// T : TableHeader< 'a, CellKey, Title >,
// T : TableSize< 'a >,
Row : Clone + for< 'cell > Cells< 'cell, CellKey, Cell > + 'a,
Title : fmt::Debug,
Cell : fmt::Debug + Clone + 'a,
Expand All @@ -192,6 +108,7 @@ pub use own::*;
pub mod own
{
use super::*;

#[ doc( inline ) ]
pub use orphan::*;
}
Expand All @@ -212,7 +129,6 @@ pub mod exposed
use super::*;

#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use private::
{
AsTable,
Expand Down
1 change: 0 additions & 1 deletion module/core/format_tools/src/format/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ pub mod exposed
use super::*;

#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use private::
{
Styles,
Expand Down
1 change: 0 additions & 1 deletion module/core/format_tools/src/format/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ pub mod exposed
use super::*;

#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use private::
{
TableSize,
Expand Down
10 changes: 9 additions & 1 deletion module/core/format_tools/src/format/to_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ pub( crate ) mod private
}
}

// impl ToStringWith< WithDisplay > for String
// {
// /// Converts the type to a string using Display formatting.
// fn to_string_with( &self ) -> String
// {
// format!( "x{}", self )
// }
// }

}

#[ doc( inline ) ]
Expand Down Expand Up @@ -86,7 +95,6 @@ pub mod exposed
{
use super::*;
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use private::
{
WithDebug,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ pub( crate ) mod private
{{
use format_tools::_ToStringWithFallback;
(
&format_tools::ToStringWithFallbackRef::< '_, _, format_tools::ToStringWithFallbackParams< $how, $fallback > >::from( &$src )
&format_tools
::ToStringWithFallbackRef
::< '_, _, format_tools::ToStringWithFallbackParams< $how, $fallback > >
::from( &$src )
)
.to_string_with_fallback()
}};
Expand Down Expand Up @@ -159,7 +162,6 @@ pub mod exposed
{
use super::*;
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use private::
{
ToStringWithFallbackRef,
Expand Down
Loading

0 comments on commit aa944d8

Please sign in to comment.