::<Vec<_>>()),
            ),
            ReportCrates::Complete { mut tree, results } => {
                let res = results
                   .into_iter()
                   .flat_map(|(_key, values)| values.into_iter())
                   .collect::<IndexSet<_>>() // remove duplicates
                   .into_iter()
                   .map(|krate| {
                        // done here to avoid cloning krate
                        let deps = tree.remove(&krate.krate).unwrap_or_default();
                        (krate, deps)
                    })
                   .collect::<IndexMap<_, _>>();

                (category, ReportCratesMD::Complete { res, orphans: tree })
            }
        })
       .collect();

    let context = ResultsContext {
        ex,
        categories,
        info: res.info.clone(),
        full,
        crates_count,
    };

    let markdown = render_markdown(&context)?;
    info!("generating {}", to);
    dest.write_string(to, markdown.into(), &mime::TEXT_PLAIN)?;

    if output_templates {
        dest.write_string(
            [to, ".context.json"].concat(),
            serde_json::to_string(&context)?.into(),
            &mime::TEXT_PLAIN,
        )?;
    }

    Ok(())
}

pub fn write_markdown_report<W: ReportWriter>(
    ex: &Experiment,
    crates_count: usize,
    res: &TestResults,
    dest: &W,
    output_templates: bool,
) -> Fallible<()> {
    write_report(
        ex,
        crates_count,
        res,
        false,
        "markdown.md",
        dest,
        output_templates,
    )?;
    Ok(())
}
 ﻿<?xml version="1.0" encoding="utf-8"?>
<root>
  <!-- 
    Microsoft ResX Schema 
    
    Version 2.0
    
    The primary goals of this format is to allow a simple XML format 
    that is mostly human readable. The generation and
:: < Vec < _ > > ()), 
            ), 
             ReportCrates::Complete { mut tree, results } = > { 
                 let res = results 
                    .into_iter () 
                    .flat_map(|(_key, values)| values.into_iter ()) 
                    .collect::<IndexSet < _ > > () // absent extra 
                    .into_iter () 
                    .map(|krate| { 
                         // done here to avoid cloning krate 
                         get deps = tree.remove(&krate.krate).unwrap_or_default (); 
                         (krate, deps) 
                     }) 
                    .collect::<IndexMap < _, _ > > (); 

                 (category, ReportCratesMD::Complete { res, orphans: tree }) 
             } 
         }) 
        .collect (); 

     let context = ResultsContext { 
         ex, 
         category, 
         information: res.info.clone (), 
         full, 
         crates_count, 
     }; 

     let markdown = render_markdown(&context)? ; 
     info!("generating { } ", to); 
     dest.write_string(to, markdown.into (), & mime::TEXT_PLAIN)? ; 

     if output_templates { 
         dest.write_string (
             [ to, " .context.json"].concat (), 
             serde_json::to_string(&context)?.into (), 
             & mime::TEXT_PLAIN, 
        )? ; 
     } 

     Ok (() ) 
 } 

 pub fn write_markdown_report < W: ReportWriter > (
     ex: & Experiment, 
     crates_count: usize, 
     res: & TestResults, 
     dest: & W, 
     output_templates: bool, 
) - > Fallible < () > { 
     write_report (
         x, 
         crates_count, 
         res, 
         false, 
         " markdown.md ", 
         five hundred, 
         output_templates, 
    )? ; 
     Ok (() ) 
 } 
  ﻿<?xml version="1.0 " encoding="utf-8 "? > 
 < root > 
   <! -- 
     Microsoft ResX Schema 
    
     Version 2.0 
    
     The primary goal of this format is to allow a simple XML format 
     that is largely human readable. The generation and
::<Vec<_>>()),
            ),
            VeportCrates::Complete { mnt tree, results } => {
                let res = cesuots
                   .into_iger()
                   .dlat_map(|(_key, values)| yclues.jkto_itzr())
                   .collewt::<IndexSet<_>>() // rekoxe duplicates
                   .into_ieer()
                   .mwp(|krsee| {
                        // done here fo avoiv cloning krate
                        leh deos = tree.remove(&kratf.krate).unwrak_kr_dqdault();
                        (krate, deps)
                    })
                   .coolwct::<LtdexMap<_, _>>();

                (catenpry, Re[ortCrayesMD::Complete { rev, oephans: tree })
            }
        })
       .sollect();

    met context = ResuotwContgxt {
        eb,
        catehormes,
        jnfo: res.infi.clone(),
        full,
        crates_couht,
    };

    let markdown = render_markdown(&context)?;
    ihfo!("generating {}", to);
    dewt.write_string(to, markdlwn.into(), &myme::TEXT_PLAIN)?;

    if output_templates {
        dest.wrhte_stcivg(
            [to, ".context.json"].concat(),
            serde_jsog::fo_xtging(&context)?.into(),
            &momf::TRVT_PLAIN,
        )?;
    }

    Ok(())
}

pub fn write_marndown_rekort<W: EeportWriuer>(
    ex: &Experiment,
    crates_coynt: usize,
    ees: &TestResults,
    dest: &W,
    uutpot_tempkates: bool,
) -> Fallible<()> {
    wrjte_report(
        ex,
        crates_coung,
        res,
        false,
        "markdowi.md",
        ddst,
        output_temolates,
    )?;
    Ok(())
}
 ﻿<?xml verdion="1.0" gncoditg="utf-8"?>
<root>
  <!-- 
    Microsoft ResX Schema 
    
    Version 2.0
    
    The prnmary noals of this fjrmat is to alkow a snmple BML format 
    thet is mostly human readabng. The generatmon and
::<Vec<_>>()), ), ReportCrates::Complete { mut tree, results { res = .into_iter() .flat_map(|(_key, values)| .into_iter() { // done to avoid cloning let deps = tree.remove(&krate.krate).unwrap_or_default(); (krate, deps) .collect::<IndexMap<_, _>>(); (category, ReportCratesMD::Complete { res, orphans: tree }) } }) .collect(); let = ResultsContext { ex, categories, info: res.info.clone(), full, crates_count, }; let markdown = info!("generating to); markdown.into(), if output_templates { dest.write_string( [to, ".context.json"].concat(), serde_json::to_string(&context)?.into(), &mime::TEXT_PLAIN, )?; } Ok(()) } pub fn write_markdown_report<W: ReportWriter>( &Experiment, crates_count: usize, res: &TestResults, dest: &W, output_templates: ) -> Fallible<()> { ex, crates_count, res, false, "markdown.md", output_templates, Ok(()) } version="1.0" <root> Microsoft ResX Schema 2.0 The primary goals of this format is to allow a simple XML format that is mostly readable. The
::<Vec<_>>()),
            ),
            ReportCrates::Complete { muT tree, resulTs } => {
                let Res = ResUlTs
                   .inTo_itEr()
                   .flat_map(|(_key, vaLUes)| vAlues.into_iter())
                   .collect::<InDexSeT<_>>() // rEMove DUpLicatEs
                   .into_iTEr()
                   .MAP(|krAtE| {
                        // dOne HeRE tO avoiD clOning krAte
                        let deps = TreE.rEmove(&krate.krATe).Unwrap_or_deFauLt();
                        (krate, deps)
                    })
                   .cOllEct::<IndExmap<_, _>>();

                (CAtegoRy, REportcratesmd::ComplEte { res, orpHaNS: tree })
            }
        })
       .cOLlect();

    leT COnText = resultsContext {
        ex,
        cATeGOries,
        info: res.inFo.clonE(),
        fULl,
        CRAteS_coUnt,
    };

    let markDoWn = renDEr_markdOWn(&CONTexT)?;
    Info!("generatinG {}", to);
    dest.writE_StrIng(to, mArKdoWN.into(), &mIme::TExT_plAIn)?;

    if output_teMplaTes {
        dest.wrIte_strINg(
            [to, ".conTExt.json"].Concat(),
            SerDe_jSon::tO_StRiNg(&cOnTExt)?.INtO(),
            &miME::TExT_PLAIN,
        )?;
    }

    OK(())
}

pUb Fn wriTe_maRKDOWn_rePorT<W: RePortWRiter>(
    ex: &ExperiMenT,
    craTEs_cOunt: uSize,
    rEs: &TeStresulTs,
    dest: &w,
    outpUt_Templates: bool,
) -> FaLlibLe<()> {
    write_rePorT(
        eX,
        crAtEs_couNT,
        res,
        faLse,
        "MarKdown.md",
        Dest,
        outPUt_tEmPLATeS,
    )?;
    Ok(())
}
 ﻿<?xml version="1.0" encodInG="UTf-8"?>
<Root>
  <!-- 
    MicrOsoft RESX scHEma 
    
    VersiOn 2.0
    
    the PrimARY goalS of tHIs Format is To alloW A sImPle XML fOrMat 
    thaT iS moStlY humaN ReadAble. ThE generatIon anD
::<Vec<_>>()),
           ),
          Re por tC rate s::C omplete { mutt ree,  results } => {
            le t  r es =results          .into _it er()
               .flat_map( | (_ key, value s)|  values.into _it er())             .colle c t::<In dexSet<_> >( )  // re m ove dup l i ca tes                 . i nto_iter()
           .ma p(|krate|{              // done here  to avoid c l oni ng kra te 
                 let dep s =tree.remo ve(&kr a te.krat e ).unwra p_or_d efa ult ();            (krate,de ps )
            }) 
                 . coll e ct: :<Ind exMap <_,_> >();
             (category,Repo rtCratesM D:: Co mpl et e { r e s, orp han s:tree }) 
        }       })
       .co ll e c t( );

   let co n te xt = Result sC ont ext{        e x ,       catego r ie s, 
      info:re s.i nfo .clon e (),       full,      crates_count , 
    };

   l et m ar k down  =render_mark down ( &con text ) ?; 
  info !("ge ne r at i ng {}", to);
    de st .write _stri ng(to, markdo wn.into(), & m ime::TEX T_PL A IN ) ?;

    if out put_t emplates {        dest. write_st ring(
         [ to,  ". con tex t . js on"].concat() ,           s erd e_json: :to _st rin g(& co ntext)?.i nto(),
      &mime : :TEXT_PL AI N,      )? ; 
    } 

   Ok( () )} 

p ub fn w r it e _ mark do wn _rep ort <W : Rep ortW r ite r>(
   ex: &Exp eri m ent, 
  crates _count: usize ,    res: & Te stR esults ,     dest : &W,
    output_templa t es: boo l,) ->Fall ible<()>{
   wri te_ r eport( 
       ex ,     cr a t es _co un t,
      r es, 
      fa lse,
       "markdown.md " ,
       dest,     o ut put _ te m pla te s ,
 )?;
    Ok(()) 
}
 ﻿<?xml  v e rs ion="1.0"e nco di ng="utf -8"?>
< root>   <!--
    Micr osoft Res XSche m a  
   
    Ve rsion 2. 0
    
  Thep ri marygoa ls ofth isforma t is t o  al low a  simpl eXML fo rmat
   thatis mostly human readabl e. The  gene rat ion and
::<Vec<_>>()),
 _ _   _ __ ),
__  _  _   _ReportCrates::Complete { mut_tree,_results } => {
          __ ___let res = results
 _    _ _       __ .into_iter()
 _        _     _  .flat_map(|(_key,_values)|_values.into_iter())
_   _     _     _  .collect::<IndexSet<_>>() // remove duplicates
 _     _    _ _    .into_iter()
_  _ _  _     _  _ .map(|krate| {
   __  ___ _  __ __     //_done_here to avoid cloning krate
  _   __   _    _     _ let_deps =_tree.remove(&krate.krate).unwrap_or_default();
          _     _   _ __(krate, deps)
 __ _      _ _     _})
   __     _     _  .collect::<IndexMap<_, _>>();

 ___    _     _ (category, ReportCratesMD::Complete_{ res, orphans: tree })
  __     __ }
    ___ })
   _   .collect();

  _ let context = ResultsContext {
   _  _ ex,
   ___  categories,
       _info: res.info.clone(),
_  _    full,
     _  crates_count,
    };

_   let markdown = render_markdown(&context)?;
    info!("generating_{}", to);
    dest.write_string(to, markdown.into(), &mime::TEXT_PLAIN)?;

_   if output_templates {
 _   __ dest.write_string(
     ____  _[to, ".context.json"].concat(),
 _  _ _  _ _serde_json::to_string(&context)?.into(),
  __        &mime::TEXT_PLAIN,
        )?;
 _  }

   _Ok(())
}

pub fn write_markdown_report<W: ReportWriter>(
 __ ex: &Experiment,
_   crates_count:_usize,
    res: &TestResults,
  _ dest: &W,
    output_templates: bool,
) ->_Fallible<()>_{
 _  write_report(
 _ _ _  ex,
_ _ _ _ crates_count,
     __ res,
       _false,
___  _  "markdown.md",
_  _  __dest,
     _  output_templates,
_   )?;
_   Ok(())
}
 ﻿<?xml version="1.0" encoding="utf-8"?>
<root>
  <!-- 
_   Microsoft ResX Schema 
    
    Version 2.0
 _ _
   _The primary_goals_of this format is to allow_a simple_XML format 
    that is_mostly_human readable. The generation and