Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE", "build.rs", "tem
[dependencies]
env_logger = "0.8.3"
anyhow = "1.0.38"
structopt = "0.3.20"
structopt = "0.3.21"
log = "0.4.14"
heck = "0.3.2"
zip = { version = "0.5.11", default-features = false }
pwasm-utils = "0.17.0"
parity-wasm = "0.42.1"
cargo_metadata = "0.12.3"
codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] }
cargo_metadata = "0.13.1"
codec = { package = "parity-scale-codec", version = "2.0.1", features = ["derive"] }
which = "4.0.2"
colored = "2.0.0"
toml = "0.5.8"
Expand Down
6 changes: 3 additions & 3 deletions src/crate_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ impl CrateMetadata {
cargo_meta: metadata,
root_package,
package_name,
original_wasm,
dest_wasm,
original_wasm: original_wasm.into(),
dest_wasm: dest_wasm.into(),
ink_version,
documentation,
homepage,
user,
target_directory,
target_directory: target_directory.into(),
};
Ok(crate_metadata)
}
Expand Down
16 changes: 2 additions & 14 deletions src/workspace/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use anyhow::{Context, Result};

use super::{metadata, Profile};
use std::convert::{TryFrom, TryInto};
use std::convert::TryFrom;
use std::{
collections::HashSet,
fs,
Expand Down Expand Up @@ -77,14 +77,6 @@ impl ManifestPath {
}
}

impl TryFrom<&PathBuf> for ManifestPath {
type Error = anyhow::Error;

fn try_from(value: &PathBuf) -> Result<Self, Self::Error> {
ManifestPath::new(value)
}
}

impl<P> TryFrom<Option<P>> for ManifestPath
where
P: AsRef<Path>,
Expand Down Expand Up @@ -126,11 +118,7 @@ impl Manifest {
/// Create new Manifest for the given manifest path.
///
/// The path *must* be to a `Cargo.toml`.
pub fn new<P>(path: P) -> Result<Manifest>
where
P: TryInto<ManifestPath, Error = anyhow::Error>,
{
let manifest_path = path.try_into()?;
pub fn new(manifest_path: ManifestPath) -> Result<Manifest> {
let toml = fs::read_to_string(&manifest_path).context("Loading Cargo.toml")?;
let toml: value::Table = toml::from_str(&toml)?;

Expand Down
5 changes: 3 additions & 2 deletions src/workspace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ impl Workspace {
package_id
)
});
let manifest = Manifest::new(&package.manifest_path)?;
let manifest_path = ManifestPath::new(&package.manifest_path)?;
let manifest = Manifest::new(manifest_path)?;
Ok((package_id.clone(), (package.clone(), manifest)))
};

Expand All @@ -73,7 +74,7 @@ impl Workspace {
}

Ok(Workspace {
workspace_root: metadata.workspace_root.clone(),
workspace_root: metadata.workspace_root.clone().into(),
root_package: root_package.clone(),
members,
})
Expand Down