summaryrefslogtreecommitdiffstats
path: root/src/commands/find_pkg.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/find_pkg.rs')
-rw-r--r--src/commands/find_pkg.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/commands/find_pkg.rs b/src/commands/find_pkg.rs
index e2f7b77..7190ef8 100644
--- a/src/commands/find_pkg.rs
+++ b/src/commands/find_pkg.rs
@@ -8,6 +8,8 @@
// SPDX-License-Identifier: EPL-2.0
//
+use std::convert::TryFrom;
+
use anyhow::Context;
use anyhow::Result;
use clap::ArgMatches;
@@ -31,8 +33,7 @@ pub async fn find_pkg(
let package_version_constraint = matches
.value_of("package_version_constraint")
- .map(String::from)
- .map(PackageVersionConstraint::new)
+ .map(PackageVersionConstraint::try_from)
.transpose()
.context("Parsing package version constraint")
.context("A valid package version constraint looks like this: '=1.0.0'")?;