1
+ //! The path module provides a trait for accessing values from a JSON-like
2
+ //! structure.
1
3
use std:: borrow:: Cow ;
2
4
3
5
use serde_json:: json;
4
6
5
7
use crate :: core:: ir:: { EvalContext , ResolverContextLike } ;
6
8
use crate :: core:: json:: JsonLike ;
7
9
8
- ///
9
- /// The path module provides a trait for accessing values from a JSON-like
10
- /// structure.
11
-
12
10
///
13
11
/// The PathString trait provides a method for accessing values from a JSON-like
14
12
/// structure. The returned value is encoded as a plain string.
@@ -66,7 +64,7 @@ pub enum ValueString<'a> {
66
64
String ( Cow < ' a , str > ) ,
67
65
}
68
66
69
- impl < ' a , Ctx : ResolverContextLike > EvalContext < ' a , Ctx > {
67
+ impl < Ctx : ResolverContextLike > EvalContext < ' _ , Ctx > {
70
68
fn to_raw_value < T : AsRef < str > > ( & self , path : & [ T ] ) -> Option < ValueString < ' _ > > {
71
69
let ctx = self ;
72
70
@@ -101,13 +99,13 @@ impl<'a, Ctx: ResolverContextLike> EvalContext<'a, Ctx> {
101
99
}
102
100
}
103
101
104
- impl < ' a , Ctx : ResolverContextLike > PathValue for EvalContext < ' a , Ctx > {
102
+ impl < Ctx : ResolverContextLike > PathValue for EvalContext < ' _ , Ctx > {
105
103
fn raw_value < ' b , T : AsRef < str > > ( & ' b self , path : & [ T ] ) -> Option < ValueString < ' b > > {
106
104
self . to_raw_value ( path)
107
105
}
108
106
}
109
107
110
- impl < ' a , Ctx : ResolverContextLike > PathString for EvalContext < ' a , Ctx > {
108
+ impl < Ctx : ResolverContextLike > PathString for EvalContext < ' _ , Ctx > {
111
109
fn path_string < T : AsRef < str > > ( & self , path : & [ T ] ) -> Option < Cow < ' _ , str > > {
112
110
self . to_raw_value ( path) . and_then ( |value| match value {
113
111
ValueString :: String ( env) => Some ( env) ,
@@ -116,7 +114,7 @@ impl<'a, Ctx: ResolverContextLike> PathString for EvalContext<'a, Ctx> {
116
114
}
117
115
}
118
116
119
- impl < ' a , Ctx : ResolverContextLike > PathGraphql for EvalContext < ' a , Ctx > {
117
+ impl < Ctx : ResolverContextLike > PathGraphql for EvalContext < ' _ , Ctx > {
120
118
fn path_graphql < T : AsRef < str > > ( & self , path : & [ T ] ) -> Option < String > {
121
119
if path. len ( ) < 2 {
122
120
return None ;
0 commit comments