Skip to content

Commit 2232dc2

Browse files
committed
refactor: remove ErrorKind's wrapping
1 parent 6892f49 commit 2232dc2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

crates/cargo-util-schemas/src/lockfile.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,9 @@ pub struct TomlLockfileSourceId {
105105
impl TomlLockfileSourceId {
106106
pub fn new(source: String) -> Result<Self, TomlLockfileSourceIdError> {
107107
let source_str = source.clone();
108-
let (kind, url) = source.split_once('+').ok_or_else(|| {
109-
TomlLockfileSourceIdError(
110-
TomlLockfileSourceIdErrorKind::InvalidSource(source.clone()).into(),
111-
)
112-
})?;
108+
let (kind, url) = source
109+
.split_once('+')
110+
.ok_or_else(|| TomlLockfileSourceIdErrorKind::InvalidSource(source.clone()))?;
113111

114112
// Sparse URLs store the kind prefix (sparse+) in the URL. Therefore, for sparse kinds, we
115113
// want to use the raw `source` instead of the splitted `url`.

0 commit comments

Comments
 (0)