Skip to content

Commit f69784f

Browse files
authored
Make Select accessors public (#2528)
1 parent 422c3b2 commit f69784f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

crate_universe/src/select.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::fmt::Debug;
33

44
use serde::{de::DeserializeOwned, Deserialize, Deserializer, Serialize};
55

6+
/// A wrapper around values where some values may be conditionally included (e.g. only on a certain platform), and others are unconditional.
67
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
78
pub struct Select<T>
89
where
@@ -78,19 +79,23 @@ where
7879
}
7980
}
8081

81-
pub(crate) fn is_empty(&self) -> bool {
82+
/// Whether there zero values in this collection, common or configuration-specific.
83+
pub fn is_empty(&self) -> bool {
8284
T::is_empty(self)
8385
}
8486

85-
pub(crate) fn configurations(&self) -> BTreeSet<String> {
87+
/// A list of the configurations which have some configuration-specific value associated.
88+
pub fn configurations(&self) -> BTreeSet<String> {
8689
self.selects.keys().cloned().collect()
8790
}
8891

89-
pub(crate) fn items(&self) -> Vec<(Option<String>, T::ItemType)> {
92+
/// All values and their associated configurations, if any.
93+
pub fn items(&self) -> Vec<(Option<String>, T::ItemType)> {
9094
T::items(self)
9195
}
9296

93-
pub(crate) fn values(&self) -> Vec<T::ItemType> {
97+
/// All values, whether common or configured.
98+
pub fn values(&self) -> Vec<T::ItemType> {
9499
T::values(self)
95100
}
96101

0 commit comments

Comments
 (0)