Skip to content

Commit dd4fd70

Browse files
authored
chore: clippy (#204)
1 parent aaef121 commit dd4fd70

File tree

4 files changed

+26
-19
lines changed

4 files changed

+26
-19
lines changed

crates/artifacts/solc/src/output_selection.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ use std::{collections::BTreeMap, fmt, str::FromStr};
66
/// Represents the desired outputs based on a File `(file -> (contract -> [outputs]))`
77
pub type FileOutputSelection = BTreeMap<String, Vec<String>>;
88

9-
/// Represents the selected output of files and contracts
9+
/// Represents the selected output of files and contracts.
10+
///
1011
/// The first level key is the file name and the second level key is the
1112
/// contract name. An empty contract name is used for outputs that are
1213
/// not tied to a contract but to the whole source file like the AST.

crates/compilers/src/compilers/mod.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,10 @@ pub trait CompilerInput: Serialize + Send + Sync + Sized + Debug {
129129
}
130130

131131
/// Parser of the source files which is used to identify imports and version requirements of the
132-
/// given source. Used by path resolver to resolve imports or determine compiler versions needed to
133-
/// compiler given sources.
132+
/// given source.
133+
///
134+
/// Used by path resolver to resolve imports or determine compiler versions needed to compiler given
135+
/// sources.
134136
pub trait ParsedSource: Debug + Sized + Send + Clone {
135137
type Language: Language;
136138

@@ -247,9 +249,10 @@ pub trait Language:
247249
const FILE_EXTENSIONS: &'static [&'static str];
248250
}
249251

250-
/// The main compiler abstraction trait. Currently mostly represents a wrapper around compiler
251-
/// binary aware of the version and able to compile given input into [CompilerOutput] including
252-
/// artifacts and errors.'
252+
/// The main compiler abstraction trait.
253+
///
254+
/// Currently mostly represents a wrapper around compiler binary aware of the version and able to
255+
/// compile given input into [`CompilerOutput`] including artifacts and errors.
253256
#[auto_impl::auto_impl(&, Box, Arc)]
254257
pub trait Compiler: Send + Sync + Clone {
255258
/// Input type for the compiler. Contains settings and sources to be compiled.

crates/compilers/src/resolver/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,10 @@ impl<D> GraphEdges<D> {
197197
}
198198
}
199199

200-
/// Represents a fully-resolved solidity dependency graph. Each node in the graph
201-
/// is a file and edges represent dependencies between them.
200+
/// Represents a fully-resolved solidity dependency graph.
201+
///
202+
/// Each node in the graph is a file and edges represent dependencies between them.
203+
///
202204
/// See also <https://docs.soliditylang.org/en/latest/layout-of-source-files.html?highlight=import#importing-other-source-files>
203205
#[derive(Debug)]
204206
pub struct Graph<D = SolData> {

crates/core/src/utils.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -399,11 +399,12 @@ pub fn resolve_absolute_library(
399399
None
400400
}
401401

402-
/// Reads the list of Solc versions that have been installed in the machine. The version list is
403-
/// sorted in ascending order.
404-
/// Checks for installed solc versions under the given path as
405-
/// `<root>/<major.minor.path>`, (e.g.: `~/.svm/0.8.10`)
406-
/// and returns them sorted in ascending order
402+
/// Reads the list of Solc versions that have been installed in the machine.
403+
///
404+
/// The version list is sorted in ascending order.
405+
///
406+
/// Checks for installed solc versions under the given path as `<root>/<major.minor.path>`,
407+
/// (e.g.: `~/.svm/0.8.10`) and returns them sorted in ascending order.
407408
pub fn installed_versions(root: &Path) -> Result<Vec<Version>, SolcError> {
408409
let mut versions: Vec<_> = walkdir::WalkDir::new(root)
409410
.max_depth(1)
@@ -619,13 +620,13 @@ pub fn create_parent_dir_all(file: &Path) -> Result<(), SolcError> {
619620
Ok(())
620621
}
621622

622-
/// Given the regex and the target string, find all occurrences
623-
/// of named groups within the string. This method returns
624-
/// the tuple of matches `(a, b)` where `a` is the match for the
625-
/// entire regex and `b` is the match for the first named group.
623+
/// Given the regex and the target string, find all occurrences of named groups within the string.
624+
///
625+
/// This method returns the tuple of matches `(a, b)` where `a` is the match for the entire regex
626+
/// and `b` is the match for the first named group.
626627
///
627-
/// NOTE: This method will return the match for the first named
628-
/// group, so the order of passed named groups matters.
628+
/// NOTE: This method will return the match for the first named group, so the order of passed named
629+
/// groups matters.
629630
pub fn capture_outer_and_inner<'a>(
630631
content: &'a str,
631632
regex: &regex::Regex,

0 commit comments

Comments
 (0)