Skip to content

Commit 01e3294

Browse files
committed
chore: rename assoc
1 parent e3c7ed1 commit 01e3294

File tree

10 files changed

+21
-22
lines changed

10 files changed

+21
-22
lines changed

crates/compilers/src/cache.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ pub(crate) struct ArtifactsCacheInner<
658658
pub cached_builds: Builds<C::Language>,
659659

660660
/// Relationship between all the files.
661-
pub edges: GraphEdges<C::ParsedSources>,
661+
pub edges: GraphEdges<C::Parser>,
662662

663663
/// The project.
664664
pub project: &'a Project<C, T>,
@@ -891,8 +891,7 @@ impl<T: ArtifactOutput<CompilerContract = C::CompilerContract>, C: Compiler>
891891

892892
// Build a temporary graph for walking imports. We need this because `self.edges`
893893
// only contains graph data for in-scope sources but we are operating on cache entries.
894-
if let Ok(graph) = Graph::<C::ParsedSources>::resolve_sources(&self.project.paths, sources)
895-
{
894+
if let Ok(graph) = Graph::<C::Parser>::resolve_sources(&self.project.paths, sources) {
896895
let (sources, edges) = graph.into_sources();
897896

898897
// Calculate content hashes for later comparison.
@@ -1022,7 +1021,7 @@ pub(crate) enum ArtifactsCache<
10221021
C: Compiler,
10231022
> {
10241023
/// Cache nothing on disk
1025-
Ephemeral(GraphEdges<C::ParsedSources>, &'a Project<C, T>),
1024+
Ephemeral(GraphEdges<C::Parser>, &'a Project<C, T>),
10261025
/// Handles the actual cached artifacts, detects artifacts that can be reused
10271026
Cached(ArtifactsCacheInner<'a, T, C>),
10281027
}
@@ -1034,7 +1033,7 @@ impl<'a, T: ArtifactOutput<CompilerContract = C::CompilerContract>, C: Compiler>
10341033
#[instrument(name = "ArtifactsCache::new", skip(project, edges))]
10351034
pub fn new(
10361035
project: &'a Project<C, T>,
1037-
edges: GraphEdges<C::ParsedSources>,
1036+
edges: GraphEdges<C::Parser>,
10381037
preprocessed: bool,
10391038
) -> Result<Self> {
10401039
/// Returns the [CompilerCache] to use
@@ -1119,7 +1118,7 @@ impl<'a, T: ArtifactOutput<CompilerContract = C::CompilerContract>, C: Compiler>
11191118
}
11201119

11211120
/// Returns the graph data for this project
1122-
pub fn graph(&self) -> &GraphEdges<C::ParsedSources> {
1121+
pub fn graph(&self) -> &GraphEdges<C::Parser> {
11231122
match self {
11241123
ArtifactsCache::Ephemeral(graph, _) => graph,
11251124
ArtifactsCache::Cached(inner) => &inner.edges,
@@ -1199,7 +1198,7 @@ impl<'a, T: ArtifactOutput<CompilerContract = C::CompilerContract>, C: Compiler>
11991198
written_artifacts: &Artifacts<A>,
12001199
written_build_infos: &Vec<RawBuildInfo<C::Language>>,
12011200
write_to_disk: bool,
1202-
) -> Result<(Artifacts<A>, Builds<C::Language>, GraphEdges<C::ParsedSources>)>
1201+
) -> Result<(Artifacts<A>, Builds<C::Language>, GraphEdges<C::Parser>)>
12031202
where
12041203
T: ArtifactOutput<Artifact = A>,
12051204
{

crates/compilers/src/compile/output/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,19 @@ pub struct ProjectCompileOutput<
8383
/// all build infos that were just compiled
8484
pub(crate) builds: Builds<C::Language>,
8585
/// The relationship between the source files and their imports
86-
pub(crate) edges: GraphEdges<C::ParsedSources>,
86+
pub(crate) edges: GraphEdges<C::Parser>,
8787
}
8888

8989
impl<T: ArtifactOutput<CompilerContract = C::CompilerContract>, C: Compiler>
9090
ProjectCompileOutput<C, T>
9191
{
9292
/// Returns the parser used to parse the sources.
93-
pub fn parser(&self) -> &C::ParsedSources {
93+
pub fn parser(&self) -> &C::Parser {
9494
self.edges.parser()
9595
}
9696

9797
/// Returns the parser used to parse the sources.
98-
pub fn parser_mut(&mut self) -> &mut C::ParsedSources {
98+
pub fn parser_mut(&mut self) -> &mut C::Parser {
9999
self.edges.parser_mut()
100100
}
101101

@@ -475,7 +475,7 @@ impl<T: ArtifactOutput<CompilerContract = C::CompilerContract>, C: Compiler>
475475
}
476476

477477
/// Returns the source graph of the project.
478-
pub fn graph(&self) -> &GraphEdges<C::ParsedSources> {
478+
pub fn graph(&self) -> &GraphEdges<C::Parser> {
479479
&self.edges
480480
}
481481
}

crates/compilers/src/compile/project.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ pub struct ProjectCompiler<
146146
C: Compiler,
147147
> {
148148
/// Contains the relationship of the source files and their imports
149-
edges: GraphEdges<C::ParsedSources>,
149+
edges: GraphEdges<C::Parser>,
150150
project: &'a Project<C, T>,
151151
/// A mapping from a source file path to the primary profile name selected for it.
152152
primary_profiles: HashMap<PathBuf, &'a str>,

crates/compilers/src/compilers/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ pub trait Compiler: Send + Sync + Clone {
355355
/// Output data for each contract
356356
type CompilerContract: CompilerContract;
357357
/// Source parser used for resolving imports and version requirements.
358-
type ParsedSources: SourceParser<ParsedSource: ParsedSource<Language = Self::Language>>;
358+
type Parser: SourceParser<ParsedSource: ParsedSource<Language = Self::Language>>;
359359
/// Compiler settings.
360360
type Settings: CompilerSettings;
361361
/// Enum of languages supported by the compiler.

crates/compilers/src/compilers/multi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ impl CompilerInput for MultiCompilerInput {
318318
impl Compiler for MultiCompiler {
319319
type Input = MultiCompilerInput;
320320
type CompilationError = MultiCompilerError;
321-
type ParsedSources = MultiCompilerParser;
321+
type Parser = MultiCompilerParser;
322322
type Settings = MultiCompilerSettings;
323323
type Language = MultiCompilerLanguage;
324324
type CompilerContract = Contract;

crates/compilers/src/compilers/solc/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl Language for SolcLanguage {
4646
impl Compiler for SolcCompiler {
4747
type Input = SolcVersionedInput;
4848
type CompilationError = Error;
49-
type ParsedSources = SolParser;
49+
type Parser = SolParser;
5050
type Settings = SolcSettings;
5151
type Language = SolcLanguage;
5252
type CompilerContract = Contract;

crates/compilers/src/compilers/vyper/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl Vyper {
202202
impl Compiler for Vyper {
203203
type Settings = VyperSettings;
204204
type CompilationError = VyperCompilationError;
205-
type ParsedSources = VyperParser;
205+
type Parser = VyperParser;
206206
type Input = VyperVersionedInput;
207207
type Language = VyperLanguage;
208208
type CompilerContract = Contract;

crates/compilers/src/flatten.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl Flattener {
192192
target: &Path,
193193
) -> std::result::Result<Self, FlattenerError>
194194
where
195-
C::ParsedSources: SourceParser<ParsedSource: MaybeSolData>,
195+
C::Parser: SourceParser<ParsedSource: MaybeSolData>,
196196
{
197197
// Configure project to compile the target file and only request AST for target file.
198198
project.cached = false;
@@ -210,7 +210,7 @@ impl Flattener {
210210
let output = output.compiler_output;
211211

212212
let sources = Source::read_all_files(vec![target.to_path_buf()])?;
213-
let graph = Graph::<C::ParsedSources>::resolve_sources(&project.paths, sources)?;
213+
let graph = Graph::<C::Parser>::resolve_sources(&project.paths, sources)?;
214214

215215
let ordered_sources = collect_ordered_deps(target, &project.paths, &graph)?;
216216

crates/compilers/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ where
175175
/// Returns standard-json-input to compile the target contract
176176
pub fn standard_json_input(&self, target: &Path) -> Result<StandardJsonCompilerInput> {
177177
trace!(?target, "Building standard-json-input");
178-
let graph = Graph::<C::ParsedSources>::resolve(&self.paths)?;
178+
let graph = Graph::<C::Parser>::resolve(&self.paths)?;
179179
let target_index = graph.files().get(target).ok_or_else(|| {
180180
SolcError::msg(format!("cannot resolve file at {:?}", target.display()))
181181
})?;
@@ -391,7 +391,7 @@ impl<T: ArtifactOutput<CompilerContract = C::CompilerContract>, C: Compiler> Pro
391391
T: Clone,
392392
C: Clone,
393393
{
394-
let graph = Graph::<C::ParsedSources>::resolve(&self.paths)?;
394+
let graph = Graph::<C::Parser>::resolve(&self.paths)?;
395395
let mut contracts: HashMap<String, Vec<PathBuf>> = HashMap::new();
396396
if !graph.is_empty() {
397397
for node in &graph.nodes {

crates/compilers/src/resolver/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub struct ResolvedSources<'a, C: Compiler> {
8888
/// a profile suffix.
8989
pub primary_profiles: HashMap<PathBuf, &'a str>,
9090
/// Graph edges.
91-
pub edges: GraphEdges<C::ParsedSources>,
91+
pub edges: GraphEdges<C::Parser>,
9292
}
9393

9494
/// The underlying edges of the graph which only contains the raw relationship data.
@@ -523,7 +523,7 @@ impl<P: SourceParser> Graph<P> {
523523
) -> Result<ResolvedSources<'_, C>>
524524
where
525525
T: ArtifactOutput<CompilerContract = C::CompilerContract>,
526-
C: Compiler<ParsedSources = P, Language = <P::ParsedSource as ParsedSource>::Language>,
526+
C: Compiler<Parser = P, Language = <P::ParsedSource as ParsedSource>::Language>,
527527
{
528528
/// insert the imports of the given node into the sources map
529529
/// There can be following graph:

0 commit comments

Comments
 (0)