aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/xpath/mod.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2025-01-10 03:19:19 -0500
committerGitHub <noreply@github.com>2025-01-10 08:19:19 +0000
commitc94d909a8688589209cdf0c7ae58e40f9b8c411e (patch)
tree12febf23eed4438249fd4d276c4d8b35dee22a97 /components/script/xpath/mod.rs
parentf220d6d3a52296794cd19935e9e59cc75a179a44 (diff)
downloadservo-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/xpath/mod.rs')
-rw-r--r--components/script/xpath/mod.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/components/script/xpath/mod.rs b/components/script/xpath/mod.rs
index b1bfa3b3089..337c5d3eab4 100644
--- a/components/script/xpath/mod.rs
+++ b/components/script/xpath/mod.rs
@@ -4,21 +4,24 @@
use context::EvaluationCtx;
use eval::Evaluatable;
-pub use eval_value::{NodesetHelpers, Value};
+pub(crate) use eval_value::{NodesetHelpers, Value};
use parser::OwnedParserError;
-pub use parser::{parse as parse_impl, Expr};
+pub(crate) use parser::{parse as parse_impl, Expr};
use super::dom::node::Node;
mod context;
+#[allow(dead_code)]
mod eval;
mod eval_function;
+#[allow(dead_code)]
mod eval_value;
+#[allow(dead_code)]
mod parser;
/// The failure modes of executing an XPath.
#[derive(Debug, PartialEq)]
-pub enum Error {
+pub(crate) enum Error {
/// The XPath was syntactically invalid
Parsing { source: OwnedParserError },
/// The XPath could not be executed
@@ -44,7 +47,7 @@ impl std::error::Error for Error {
}
/// Parse an XPath expression from a string
-pub fn parse(xpath: &str) -> Result<Expr, Error> {
+pub(crate) fn parse(xpath: &str) -> Result<Expr, Error> {
match parse_impl(xpath) {
Ok(expr) => {
debug!("Parsed XPath: {:?}", expr);
@@ -58,7 +61,7 @@ pub fn parse(xpath: &str) -> Result<Expr, Error> {
}
/// Evaluate an already-parsed XPath expression
-pub fn evaluate_parsed_xpath(expr: &Expr, context_node: &Node) -> Result<Value, Error> {
+pub(crate) fn evaluate_parsed_xpath(expr: &Expr, context_node: &Node) -> Result<Value, Error> {
let context = EvaluationCtx::new(context_node);
match expr.evaluate(&context) {
Ok(v) => {