diff options
author | Josh Matthews <josh@joshmatthews.net> | 2025-01-10 03:19:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-10 08:19:19 +0000 |
commit | c94d909a8688589209cdf0c7ae58e40f9b8c411e (patch) | |
tree | 12febf23eed4438249fd4d276c4d8b35dee22a97 /components/script/dom/gamepadbutton.rs | |
parent | f220d6d3a52296794cd19935e9e59cc75a179a44 (diff) | |
download | servo-c94d909a8688589209cdf0c7ae58e40f9b8c411e.tar.gz servo-c94d909a8688589209cdf0c7ae58e40f9b8c411e.zip |
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>
Diffstat (limited to 'components/script/dom/gamepadbutton.rs')
-rw-r--r-- | components/script/dom/gamepadbutton.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/components/script/dom/gamepadbutton.rs b/components/script/dom/gamepadbutton.rs index 4605983ae6a..7a66654e5e6 100644 --- a/components/script/dom/gamepadbutton.rs +++ b/components/script/dom/gamepadbutton.rs @@ -14,7 +14,7 @@ use crate::dom::globalscope::GlobalScope; use crate::script_runtime::CanGc; #[dom_struct] -pub struct GamepadButton { +pub(crate) struct GamepadButton { reflector_: Reflector, pressed: Cell<bool>, touched: Cell<bool>, @@ -22,7 +22,7 @@ pub struct GamepadButton { } impl GamepadButton { - pub fn new_inherited(pressed: bool, touched: bool) -> GamepadButton { + pub(crate) fn new_inherited(pressed: bool, touched: bool) -> GamepadButton { Self { reflector_: Reflector::new(), pressed: Cell::new(pressed), @@ -31,7 +31,11 @@ impl GamepadButton { } } - pub fn new(global: &GlobalScope, pressed: bool, touched: bool) -> DomRoot<GamepadButton> { + pub(crate) fn new( + global: &GlobalScope, + pressed: bool, + touched: bool, + ) -> DomRoot<GamepadButton> { reflect_dom_object( Box::new(GamepadButton::new_inherited(pressed, touched)), global, @@ -58,7 +62,7 @@ impl GamepadButtonMethods<crate::DomTypeHolder> for GamepadButton { } impl GamepadButton { - pub fn update(&self, pressed: bool, touched: bool, value: f64) { + pub(crate) fn update(&self, pressed: bool, touched: bool, value: f64) { self.pressed.set(pressed); self.touched.set(touched); self.value.set(value); |