/// Calculates the adjusted date using the `modified following` convention and returns it in a form of
/// `Option<NaiveDate>` enum.
///
/// If the supplied date is a business date, it is returned with no adjustment.
/// Otherwise, the adjusted date will be the first business day following the unadjusted date,
/// unless it falls in the next month. In such case, the first preceding business day is returned.
/// 
/// Returns `None` if no such business day exist.    
Calculates the adjusted date using the `modified following` convention and returns it in a form of
`Option` enum.

If the supplied date is a business date, it is returned with no adjustment.
Otherwise, the adjusted date will be the first business day following the unadjusted date,
unless it falls in the next month. In such case, the first preceding business day is returned.

Returns `None` if no such business day exist.
Calculates the adjusted date using the ` modified following ` convention and returns it in a form of ` Option ` enum . If the supplied date is a business date it is returned with no adjustment . Otherwise the adjusted date will be the first business day following the unadjusted date unless it falls in the next month . In such case the first preceding business day is returned . Returns ` None ` if no such business day exist .
fn modified_following(&self, mut day: NaiveDate) -> Option<NaiveDate> {
        let unadjusted = day;
        if self.is_business(day) {
            return Some(day);
        }
        while day < chrono::naive::MAX_DATE && day.month() == unadjusted.month() {
            day += Duration::days(1);
            if day.month() != unadjusted.month() {
                break;
            }
        }
        day = unadjusted;
        while day > chrono::naive::MIN_DATE {
            day -= Duration::days(1);
            if self.is_business(day) {
                return Some(day);
            }
        }
        None
    }
fn modified_following ( & self , mut day : NaiveDate ) -> Option < NaiveDate > { let unadjusted = day ; if self . is_business ( day ) { return Some ( day ) ; } while day < chrono :: naive :: MAX_DATE && day . month ( ) == unadjusted . month ( ) { day += Duration :: days ( 1 ) ; if day . month ( ) != unadjusted . month ( ) { break ; } } day = unadjusted ; while day > chrono :: naive :: MIN_DATE { day -= Duration :: days ( 1 ) ; if self . is_business ( day ) { return Some ( day ) ; } } None }
Calculates the adjusted date using the `modified following` convention and returns it in a form of
`Option<NaiveDate>` enum.
Calculates the adjusted date using the ` modified following ` convention and returns it in a form of ` Option<NaiveDate > ` enum .
&self
<not_specific>
day
NaiveDate
<not_specific>