mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
script: Limit public exports. (#34915)
* script: Restrict reexport visibility of DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Mass pub->pub(crate) conversion. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Hide existing dead code warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix unit tests. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * More formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
f220d6d3a5
commit
c94d909a86
585 changed files with 5411 additions and 5013 deletions
|
@ -21,7 +21,7 @@ struct TimeRange {
|
|||
}
|
||||
|
||||
impl TimeRange {
|
||||
pub fn union(&mut self, other: &TimeRange) {
|
||||
pub(crate) fn union(&mut self, other: &TimeRange) {
|
||||
self.start = f64::min(self.start, other.start);
|
||||
self.end = f64::max(self.end, other.end);
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ impl TimeRange {
|
|||
other.start == self.end || other.end == self.start
|
||||
}
|
||||
|
||||
pub fn is_before(&self, other: &TimeRange) -> bool {
|
||||
pub(crate) fn is_before(&self, other: &TimeRange) -> bool {
|
||||
other.start >= self.end
|
||||
}
|
||||
}
|
||||
|
@ -63,11 +63,12 @@ pub struct TimeRangesContainer {
|
|||
}
|
||||
|
||||
impl TimeRangesContainer {
|
||||
#[allow(clippy::len_without_is_empty)]
|
||||
pub fn len(&self) -> u32 {
|
||||
self.ranges.len() as u32
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
pub(crate) fn is_empty(&self) -> bool {
|
||||
self.ranges.is_empty()
|
||||
}
|
||||
|
||||
|
@ -126,7 +127,7 @@ impl TimeRangesContainer {
|
|||
}
|
||||
|
||||
#[dom_struct]
|
||||
pub struct TimeRanges {
|
||||
pub(crate) struct TimeRanges {
|
||||
reflector_: Reflector,
|
||||
ranges: TimeRangesContainer,
|
||||
}
|
||||
|
@ -139,7 +140,7 @@ impl TimeRanges {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new(window: &Window, ranges: TimeRangesContainer) -> DomRoot<TimeRanges> {
|
||||
pub(crate) fn new(window: &Window, ranges: TimeRangesContainer) -> DomRoot<TimeRanges> {
|
||||
reflect_dom_object(
|
||||
Box::new(TimeRanges::new_inherited(ranges)),
|
||||
window,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue