aboutsummaryrefslogtreecommitdiff
path: root/crate_universe/src/utils/starlark/serialize.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crate_universe/src/utils/starlark/serialize.rs')
-rw-r--r--crate_universe/src/utils/starlark/serialize.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/crate_universe/src/utils/starlark/serialize.rs b/crate_universe/src/utils/starlark/serialize.rs
index 1368f7bb..b6dc7d88 100644
--- a/crate_universe/src/utils/starlark/serialize.rs
+++ b/crate_universe/src/utils/starlark/serialize.rs
@@ -10,21 +10,21 @@ use super::{
// that attribute is that they get serialized as a map, not struct. In Starlark
// unlike in JSON, maps and structs are differently serialized, so we need to
// help fill in the function name or else we'd get a Starlark map instead.
-pub fn rust_proc_macro<S>(rule: &RustProcMacro, serializer: S) -> Result<S::Ok, S::Error>
+pub(crate) fn rust_proc_macro<S>(rule: &RustProcMacro, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
FunctionCall::new("rust_proc_macro", rule).serialize(serializer)
}
-pub fn rust_library<S>(rule: &RustLibrary, serializer: S) -> Result<S::Ok, S::Error>
+pub(crate) fn rust_library<S>(rule: &RustLibrary, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
FunctionCall::new("rust_library", rule).serialize(serializer)
}
-pub fn rust_binary<S>(rule: &RustBinary, serializer: S) -> Result<S::Ok, S::Error>
+pub(crate) fn rust_binary<S>(rule: &RustBinary, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
@@ -34,7 +34,7 @@ where
// Serialize an array with each element on its own line, even if there is just a
// single element which serde_starlark would ordinarily place on the same line
// as the array brackets.
-pub struct MultilineArray<'a, A>(pub &'a A);
+pub(crate) struct MultilineArray<'a, A>(pub(crate) &'a A);
impl<'a, A, T> Serialize for MultilineArray<'a, A>
where
@@ -129,8 +129,8 @@ impl Serialize for ExportsFiles {
}
impl Data {
- pub fn is_empty(&self) -> bool {
- self.glob.is_empty() && self.select.is_empty()
+ pub(crate) fn is_empty(&self) -> bool {
+ self.glob.has_any_include() && self.select.is_empty()
}
}
@@ -140,10 +140,10 @@ impl Serialize for Data {
S: Serializer,
{
let mut plus = serializer.serialize_tuple_struct("+", MULTILINE)?;
- if !self.glob.is_empty() {
+ if !self.glob.has_any_include() {
plus.serialize_field(&self.glob)?;
}
- if !self.select.is_empty() || self.glob.is_empty() {
+ if !self.select.is_empty() || self.glob.has_any_include() {
plus.serialize_field(&self.select)?;
}
plus.end()