summaryrefslogtreecommitdiffstats
path: root/src/commands/env_of.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/env_of.rs')
-rw-r--r--src/commands/env_of.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/commands/env_of.rs b/src/commands/env_of.rs
index 4ee48d1..c763a23 100644
--- a/src/commands/env_of.rs
+++ b/src/commands/env_of.rs
@@ -8,6 +8,8 @@
// SPDX-License-Identifier: EPL-2.0
//
+use std::convert::TryFrom;
+
use anyhow::Result;
use clap::ArgMatches;
use log::trace;
@@ -29,8 +31,7 @@ pub async fn env_of(matches: &ArgMatches, repo: Repository) -> Result<()> {
.unwrap();
let constraint = matches
.value_of("package_version_constraint")
- .map(String::from)
- .map(PackageVersionConstraint::new)
+ .map(PackageVersionConstraint::try_from)
.unwrap()?;
trace!(
"Checking for package with name = {} and version = {:?}",