Skip to content

Commit 179dace

Browse files
author
Nichol Yip
committed
Removed redundant struct and replaced with using LintedItem instead.
Signed-off-by: Nichol Yip <[email protected]>
1 parent 1b682e9 commit 179dace

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

crates/spk-schema/src/v0/spec.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -847,19 +847,14 @@ where
847847
}
848848
}
849849

850-
pub struct LintedBuildSpec {
851-
build_spec: BuildSpec,
852-
lints: Vec<Lint>,
853-
}
854-
855850
#[derive(FieldNamesAsArray)]
856851
struct SpecVisitor<B, T> {
857852
pkg: Option<Ident<B, T>>,
858853
meta: Option<LintedItem<Meta>>,
859854
compat: Option<Compat>,
860855
deprecated: Option<bool>,
861856
sources: Option<Vec<LintedItem<SourceSpec>>>,
862-
build: Option<LintedBuildSpec>,
857+
build: Option<LintedItem<BuildSpec>>,
863858
tests: Option<Vec<LintedItem<TestSpec>>>,
864859
install: Option<LintedItem<InstallSpec>>,
865860
#[field_names_as_array(skip)]
@@ -907,7 +902,7 @@ where
907902
.collect_vec()
908903
},
909904
build: match value.build.take() {
910-
Some(build) => build.build_spec,
905+
Some(build) => build.item,
911906
None => Default::default(),
912907
},
913908
tests: value
@@ -1004,7 +999,10 @@ where
1004999
build.item.try_into().map_err(serde::de::Error::custom)?
10051000
};
10061001

1007-
Some(LintedBuildSpec { build_spec, lints })
1002+
Some(LintedItem {
1003+
item: build_spec,
1004+
lints,
1005+
})
10081006
}
10091007
}
10101008
"tests" => self.tests = Some(map.next_value::<Vec<LintedItem<TestSpec>>>()?),

0 commit comments

Comments
 (0)