chore(solc): add display impl for PathsConfig (#708)

This commit is contained in:
Matthias Seitz 2021-12-19 13:35:11 +01:00 committed by GitHub
parent 8f8a813181
commit e0ac32a68f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 1 deletions

View File

@ -11,7 +11,9 @@ use serde::{de::DeserializeOwned, Deserialize, Serialize};
use std::{ use std::{
collections::BTreeMap, collections::BTreeMap,
convert::TryFrom, convert::TryFrom,
fmt, fs, io, fmt,
fmt::Formatter,
fs, io,
path::{Path, PathBuf}, path::{Path, PathBuf},
}; };
@ -75,6 +77,24 @@ impl ProjectPathsConfig {
} }
} }
impl fmt::Display for ProjectPathsConfig {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
writeln!(f, "root: {}", self.root.display())?;
writeln!(f, "contracts: {}", self.sources.display())?;
writeln!(f, "artifacts: {}", self.artifacts.display())?;
writeln!(f, "tests: {}", self.tests.display())?;
writeln!(f, "libs:")?;
for lib in &self.libraries {
writeln!(f, " {}", lib.display())?;
}
writeln!(f, "remappings:")?;
for remapping in &self.remappings {
writeln!(f, " {}", remapping)?;
}
Ok(())
}
}
#[derive(Debug, Clone, Eq, PartialEq)] #[derive(Debug, Clone, Eq, PartialEq)]
pub enum PathStyle { pub enum PathStyle {
HardHat, HardHat,