@@ -175,28 +175,28 @@ async fn udf_version<RT: Runtime>(
175175/// - Checking the args size.
176176/// - Checking that the args pass validation.
177177///
178- /// This should only be constructed via `ValidatedUdfPath ::new` to use the type
179- /// system to enforce that validation is never skipped.
178+ /// This should only be constructed via `ValidatedPathAndArgs ::new` to use the
179+ /// type system to enforce that validation is never skipped.
180180#[ derive( Clone , Eq , PartialEq ) ]
181181#[ cfg_attr( any( test, feature = "testing" ) , derive( Debug ) ) ]
182- pub struct ValidatedUdfPathAndArgs {
182+ pub struct ValidatedPathAndArgs {
183183 path : CanonicalizedComponentFunctionPath ,
184184 args : ConvexArray ,
185185 // Not set for system modules.
186186 npm_version : Option < Version > ,
187187}
188188
189189#[ cfg( any( test, feature = "testing" ) ) ]
190- impl Arbitrary for ValidatedUdfPathAndArgs {
190+ impl Arbitrary for ValidatedPathAndArgs {
191191 type Parameters = ( ) ;
192192
193- type Strategy = impl Strategy < Value = ValidatedUdfPathAndArgs > ;
193+ type Strategy = impl Strategy < Value = ValidatedPathAndArgs > ;
194194
195195 fn arbitrary_with ( ( ) : Self :: Parameters ) -> Self :: Strategy {
196196 use proptest:: prelude:: * ;
197197
198198 any :: < ( CanonicalizedComponentFunctionPath , ConvexArray ) > ( ) . prop_map ( |( path, args) | {
199- ValidatedUdfPathAndArgs {
199+ ValidatedPathAndArgs {
200200 path,
201201 args,
202202 npm_version : None ,
@@ -205,9 +205,9 @@ impl Arbitrary for ValidatedUdfPathAndArgs {
205205 }
206206}
207207
208- impl ValidatedUdfPathAndArgs {
208+ impl ValidatedPathAndArgs {
209209 /// Check if the function being called matches the allowed visibility and
210- /// return a ValidatedUdfPath or an appropriate JsError.
210+ /// return a ValidatedPathAndARgs or an appropriate JsError.
211211 ///
212212 /// We want to use the same error message for "this function exists, but
213213 /// with the wrong visibility" and "this function does not exist" so we
@@ -218,7 +218,7 @@ impl ValidatedUdfPathAndArgs {
218218 path : CanonicalizedComponentFunctionPath ,
219219 args : ConvexArray ,
220220 expected_udf_type : UdfType ,
221- ) -> anyhow:: Result < Result < ValidatedUdfPathAndArgs , JsError > > {
221+ ) -> anyhow:: Result < Result < ValidatedPathAndArgs , JsError > > {
222222 if path. udf_path . is_system ( ) {
223223 anyhow:: ensure!(
224224 path. component. is_root( ) ,
@@ -228,7 +228,7 @@ impl ValidatedUdfPathAndArgs {
228228 // We don't analyze system modules, so we don't validate anything
229229 // except the identity for them.
230230 let result = if tx. identity ( ) . is_admin ( ) || tx. identity ( ) . is_system ( ) {
231- Ok ( ValidatedUdfPathAndArgs {
231+ Ok ( ValidatedPathAndArgs {
232232 path,
233233 args,
234234 npm_version : None ,
@@ -321,7 +321,7 @@ impl ValidatedUdfPathAndArgs {
321321 ) ) ) ) ;
322322 }
323323
324- Ok ( Ok ( ValidatedUdfPathAndArgs {
324+ Ok ( Ok ( ValidatedPathAndArgs {
325325 path,
326326 args,
327327 npm_version : Some ( udf_version) ,
@@ -386,15 +386,15 @@ impl ValidatedUdfPathAndArgs {
386386 }
387387}
388388
389- impl TryFrom < ValidatedUdfPathAndArgs > for pb:: common:: PathAndArgs {
389+ impl TryFrom < ValidatedPathAndArgs > for pb:: common:: PathAndArgs {
390390 type Error = anyhow:: Error ;
391391
392392 fn try_from (
393- ValidatedUdfPathAndArgs {
393+ ValidatedPathAndArgs {
394394 path,
395395 args,
396396 npm_version,
397- } : ValidatedUdfPathAndArgs ,
397+ } : ValidatedPathAndArgs ,
398398 ) -> anyhow:: Result < Self > {
399399 let args_json = JsonValue :: from ( args) ;
400400 let args = serde_json:: to_vec ( & args_json) ?;
@@ -476,16 +476,16 @@ mod test {
476476
477477 use proptest:: prelude:: * ;
478478
479- use crate :: ValidatedUdfPathAndArgs ;
479+ use crate :: ValidatedPathAndArgs ;
480480 proptest ! {
481481 #![ proptest_config(
482482 ProptestConfig { failure_persistence: None , ..ProptestConfig :: default ( ) }
483483 ) ]
484484
485485 #[ test]
486- fn test_udf_path_proto_roundtrip( v in any:: <ValidatedUdfPathAndArgs >( ) ) {
486+ fn test_udf_path_proto_roundtrip( v in any:: <ValidatedPathAndArgs >( ) ) {
487487 let proto = pb:: common:: PathAndArgs :: try_from( v. clone( ) ) . unwrap( ) ;
488- let v2 = ValidatedUdfPathAndArgs :: from_proto( proto) . unwrap( ) ;
488+ let v2 = ValidatedPathAndArgs :: from_proto( proto) . unwrap( ) ;
489489 assert_eq!( v, v2) ;
490490 }
491491 }
0 commit comments