Skip to content

Commit 6ee5067

Browse files
authored
Make BRP builtins utilities parse and parse_some public (#22005)
# Objective Builtin BRP methods make constant use of `parse` and `parse_some` in parsing utilities. Making them public allows users to use them in their own code. ## Solution Make both functions `pub`. ## Testing I think testing is not necessary, especially since doc strings do not link anywhere.
1 parent ec072d8 commit 6ee5067

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/bevy_remote/src/builtin_methods.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ pub struct BrpQueryRow {
479479
}
480480

481481
/// A helper function used to parse a `serde_json::Value`.
482-
fn parse<T: for<'de> Deserialize<'de>>(value: Value) -> Result<T, BrpError> {
482+
pub fn parse<T: for<'de> Deserialize<'de>>(value: Value) -> Result<T, BrpError> {
483483
serde_json::from_value(value).map_err(|err| BrpError {
484484
code: error_codes::INVALID_PARAMS,
485485
message: err.to_string(),
@@ -488,7 +488,7 @@ fn parse<T: for<'de> Deserialize<'de>>(value: Value) -> Result<T, BrpError> {
488488
}
489489

490490
/// A helper function used to parse a `serde_json::Value` wrapped in an `Option`.
491-
fn parse_some<T: for<'de> Deserialize<'de>>(value: Option<Value>) -> Result<T, BrpError> {
491+
pub fn parse_some<T: for<'de> Deserialize<'de>>(value: Option<Value>) -> Result<T, BrpError> {
492492
match value {
493493
Some(value) => parse(value),
494494
None => Err(BrpError {

0 commit comments

Comments
 (0)