Let's give our crate a quick run out

As it stands, our crate is far from finished. However, there is enough code in there to see whether it actually runs.

Code for this section is in Chapter10/first_run_out.

Our initial code looks like this:

extern crate mathslib; 
use mathslib::conversions::temperature::*;  
fn main()  
{ 
    let mut testval = celcius_to_fahrenheit(100f32); 
    println!("100C = {}F", testval.1); // should be 212 
} 

When we build this, we get the following:

Figure 7

This stands to reason; we're asking the code to include a library that it has no clue about.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset