@@ -881,11 +881,16 @@ fn fmt_type<'cx>(
881
881
}
882
882
}
883
883
}
884
- clean:: Slice ( ref t) => {
885
- primitive_link ( f, PrimitiveType :: Slice , "[" , cx) ?;
886
- fmt:: Display :: fmt ( & t. print ( cx) , f) ?;
887
- primitive_link ( f, PrimitiveType :: Slice , "]" , cx)
888
- }
884
+ clean:: Slice ( ref t) => match * * t {
885
+ clean:: Generic ( name) => {
886
+ primitive_link ( f, PrimitiveType :: Slice , & format ! ( "[{name}]" ) , cx)
887
+ }
888
+ _ => {
889
+ primitive_link ( f, PrimitiveType :: Slice , "[" , cx) ?;
890
+ fmt:: Display :: fmt ( & t. print ( cx) , f) ?;
891
+ primitive_link ( f, PrimitiveType :: Slice , "]" , cx)
892
+ }
893
+ } ,
889
894
clean:: Array ( ref t, ref n) => {
890
895
primitive_link ( f, PrimitiveType :: Array , "[" , cx) ?;
891
896
fmt:: Display :: fmt ( & t. print ( cx) , f) ?;
@@ -924,23 +929,12 @@ fn fmt_type<'cx>(
924
929
clean:: Slice ( ref bt) => {
925
930
// `BorrowedRef{ ... Slice(T) }` is `&[T]`
926
931
match * * bt {
927
- clean:: Generic ( _) => {
928
- if f. alternate ( ) {
929
- primitive_link (
930
- f,
931
- PrimitiveType :: Slice ,
932
- & format ! ( "{}{}{}[{:#}]" , amp, lt, m, bt. print( cx) ) ,
933
- cx,
934
- )
935
- } else {
936
- primitive_link (
937
- f,
938
- PrimitiveType :: Slice ,
939
- & format ! ( "{}{}{}[{}]" , amp, lt, m, bt. print( cx) ) ,
940
- cx,
941
- )
942
- }
943
- }
932
+ clean:: Generic ( name) => primitive_link (
933
+ f,
934
+ PrimitiveType :: Slice ,
935
+ & format ! ( "{amp}{lt}{m}[{name}]" ) ,
936
+ cx,
937
+ ) ,
944
938
_ => {
945
939
primitive_link (
946
940
f,
0 commit comments