@@ -198,34 +198,34 @@ impl ConfigurationSection for TelemetryConfig {
198
198
& self ,
199
199
_figment : & figment:: Figment ,
200
200
) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
201
- if let Some ( sample_rate) = self . sentry . sample_rate {
202
- if !( 0.0 ..=1.0 ) . contains ( & sample_rate) {
203
- return Err ( figment :: error :: Error :: custom (
204
- "Sentry sample rate must be between 0.0 and 1.0" ,
205
- )
206
- . with_path ( "sentry.sample_rate" )
207
- . into ( ) ) ;
208
- }
201
+ if let Some ( sample_rate) = self . sentry . sample_rate
202
+ && !( 0.0 ..=1.0 ) . contains ( & sample_rate)
203
+ {
204
+ return Err ( figment :: error :: Error :: custom (
205
+ "Sentry sample rate must be between 0.0 and 1.0" ,
206
+ )
207
+ . with_path ( "sentry.sample_rate" )
208
+ . into ( ) ) ;
209
209
}
210
210
211
- if let Some ( sample_rate) = self . sentry . traces_sample_rate {
212
- if !( 0.0 ..=1.0 ) . contains ( & sample_rate) {
213
- return Err ( figment :: error :: Error :: custom (
214
- "Sentry sample rate must be between 0.0 and 1.0" ,
215
- )
216
- . with_path ( "sentry.traces_sample_rate" )
217
- . into ( ) ) ;
218
- }
211
+ if let Some ( sample_rate) = self . sentry . traces_sample_rate
212
+ && !( 0.0 ..=1.0 ) . contains ( & sample_rate)
213
+ {
214
+ return Err ( figment :: error :: Error :: custom (
215
+ "Sentry sample rate must be between 0.0 and 1.0" ,
216
+ )
217
+ . with_path ( "sentry.traces_sample_rate" )
218
+ . into ( ) ) ;
219
219
}
220
220
221
- if let Some ( sample_rate) = self . tracing . sample_rate {
222
- if !( 0.0 ..=1.0 ) . contains ( & sample_rate) {
223
- return Err ( figment :: error :: Error :: custom (
224
- "Tracing sample rate must be between 0.0 and 1.0" ,
225
- )
226
- . with_path ( "tracing.sample_rate" )
227
- . into ( ) ) ;
228
- }
221
+ if let Some ( sample_rate) = self . tracing . sample_rate
222
+ && !( 0.0 ..=1.0 ) . contains ( & sample_rate)
223
+ {
224
+ return Err ( figment :: error :: Error :: custom (
225
+ "Tracing sample rate must be between 0.0 and 1.0" ,
226
+ )
227
+ . with_path ( "tracing.sample_rate" )
228
+ . into ( ) ) ;
229
229
}
230
230
231
231
Ok ( ( ) )
0 commit comments