@@ -881,11 +881,16 @@ fn fmt_type<'cx>(
881881 }
882882 }
883883 }
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+ } ,
889894 clean:: Array ( ref t, ref n) => {
890895 primitive_link ( f, PrimitiveType :: Array , "[" , cx) ?;
891896 fmt:: Display :: fmt ( & t. print ( cx) , f) ?;
@@ -924,23 +929,12 @@ fn fmt_type<'cx>(
924929 clean:: Slice ( ref bt) => {
925930 // `BorrowedRef{ ... Slice(T) }` is `&[T]`
926931 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+ ) ,
944938 _ => {
945939 primitive_link (
946940 f,
0 commit comments