You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: nelson_siegel_svensson.rs
    path of file: ./repos/RustQuant/src/data/curves
    
    the code of the file until where you have to start completion: // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    fn spot_rate(&self, date: Date) -> f64 {
        assert!(date > today(), "Date must be in the future.");

        let tau = DayCountConvention::default().day_count_factor(today(), date);

        let term1 = self.lambda1 * (1. - f64::exp(-tau / self.lambda1)) / tau;
        let term2 = term1 - f64::exp(-tau / self.lambda1);
        let term3 = self.lambda2 * (1. - f64::exp(-tau / self.lambda2)) / tau
            - f64::exp(-tau / self.lambda2);

        self.beta0 + self.beta1 * term1 + self.beta2 * term2 + self.beta3 * term3
    }