| 1 | use craterust-analyzer cargo rrule 0.14.0 crate/::validatorrust-analyzer cargo rrule 0.14.0 validator/::{ValidationErrorrust-analyzer cargo rrule 0.14.0 validator/error/ValidationError#, YEAR_RANGErust-analyzer cargo rrule 0.14.0 validator/validate_rrule/YEAR_RANGE.}; |
| 2 | |
| 3 | pub(craterust-analyzer cargo rrule 0.14.0 crate/) fn check_year_rangerust-analyzer cargo rrule 0.14.0 iter/checks/check_year_range().(year: i32) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), ValidationErrorrust-analyzer cargo rrule 0.14.0 validator/error/ValidationError#> { |
| 4 | if YEAR_RANGErust-analyzer cargo rrule 0.14.0 validator/validate_rrule/YEAR_RANGE..containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/impl#[`RangeInclusive<Idx>`]contains().(&year) { |
| 5 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 6 | } else { |
| 7 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(ValidationErrorrust-analyzer cargo rrule 0.14.0 validator/error/ValidationError#::InvalidFieldValueRangerust-analyzer cargo rrule 0.14.0 validator/error/ValidationError#InvalidFieldValueRange# { |
| 8 | fieldrust-analyzer cargo rrule 0.14.0 validator/error/ValidationError#InvalidFieldValueRange#field.: "YEAR".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 9 | valuerust-analyzer cargo rrule 0.14.0 validator/error/ValidationError#InvalidFieldValueRange#value.: year.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 10 | start_idxrust-analyzer cargo rrule 0.14.0 validator/error/ValidationError#InvalidFieldValueRange#start_idx.: YEAR_RANGErust-analyzer cargo rrule 0.14.0 validator/validate_rrule/YEAR_RANGE..startrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/impl#[`RangeInclusive<Idx>`]start().().to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 11 | end_idxrust-analyzer cargo rrule 0.14.0 validator/error/ValidationError#InvalidFieldValueRange#end_idx.: YEAR_RANGErust-analyzer cargo rrule 0.14.0 validator/validate_rrule/YEAR_RANGE..endrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/impl#[`RangeInclusive<Idx>`]end().().to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 12 | }) |
| 13 | } |
| 14 | } |