@@ -32,9 +32,7 @@ impl NatSpec {
3232 pub fn parse ( output : & ProjectCompileOutput , root : & Path ) -> Vec < Self > {
3333 let mut natspecs: Vec < Self > = vec ! [ ] ;
3434
35- let artifacts = artifacts :: < _ , ConfigurableArtifacts > ( output. cached_artifacts ( ) )
36- . chain ( artifacts :: < _ , ConfigurableArtifacts > ( output. compiled_artifacts ( ) ) ) ;
37- for ( id, artifact) in artifacts {
35+ for ( id, artifact) in output. artifact_ids ( ) {
3836 let Some ( ast) = & artifact. ast else { continue } ;
3937 let path = id. source . as_path ( ) ;
4038 let path = path. strip_prefix ( root) . unwrap_or ( path) ;
@@ -89,31 +87,6 @@ fn contract_root_node<'a>(nodes: &'a [Node], contract_id: &'a str) -> Option<&'a
8987 None
9088}
9189
92- // borrowed version of `Artifacts::into_artifacts`
93- fn artifacts < ' a , T , O : ArtifactOutput < Artifact = T > > (
94- a : & ' a Artifacts < T > ,
95- ) -> impl Iterator < Item = ( ArtifactId , & ' a T ) > + ' a {
96- a. 0 . iter ( ) . flat_map ( |( file, contract_artifacts) | {
97- contract_artifacts. iter ( ) . flat_map ( move |( _contract_name, artifacts) | {
98- let source = PathBuf :: from ( file. clone ( ) ) ;
99- artifacts. iter ( ) . filter_map ( move |artifact| {
100- O :: contract_name ( & artifact. file ) . map ( |name| {
101- (
102- ArtifactId {
103- path : PathBuf :: from ( & artifact. file ) ,
104- name,
105- source : source. clone ( ) ,
106- version : artifact. version . clone ( ) ,
107- }
108- . with_slashed_paths ( ) ,
109- & artifact. artifact ,
110- )
111- } )
112- } )
113- } )
114- } )
115- }
116-
11790/// Implements a DFS over a compiler output node and its children.
11891/// If a natspec is found it is added to `natspecs`
11992fn apply ( natspecs : & mut Vec < NatSpec > , contract : & str , node : & Node ) {
0 commit comments