extern crate lcm;

// mod exlcm;
mod exlcm {
    include!(concat!(env!("OUT_DIR"), "/exlcm/example_t.rs"));
}

// mod exlcm_backup;
// use exlcm_backup as exlcm;

fn main() {
    let mut lcm = lcm::Lcm::new();

    let mut my_data = exlcm::ExampleT::new();
    // let mut my_data = exlcm::Example::new();
    my_data.timestamp = 0;

    my_data.position[0] = 1.0;
    my_data.position[1] = 2.0;
    my_data.position[2] = 3.0;

    my_data.orientation[0] = 1.0;
    my_data.orientation[1] = 0.0;
    my_data.orientation[2] = 0.0;
    my_data.orientation[3] = 0.0;

    my_data.num_ranges = 15;
    my_data.ranges = (0..15).collect();

    my_data.name = "example string".to_string();
    my_data.enabled = true;

    match lcm.publish("EXAMPLE", &my_data) {
        Ok(()) => println!("Sent message."),
        Err(e) => println!("Failed to send message: {}", e)
    }
}

extern crate lcm;

// mod exlcm;
mod exlcm {
    include!(concat!(env!("OUT_DIR"), "/exlcm/example_t.rs"));
}

// mod exlcm_backup;
// use exlcm_backup as exlcm;

fn main() {
    let mut lcm = lcm::Lcm::new();

    let mut my_data = exlcm::ExampleT::new();
    // let mut my_data = exlcm::Example::new();
    my_data.timestamp = 0;

    my_data.position[0] = 1.0;
    my_data.position[1] = 2.0;
    my_data.position[2] = 3.0;

    my_data.orientation[0] = 1.0;
    my_data.orientation[1] = 0.0;
    my_data.orientation[2] = 0.0;
    my_data.orientation[3] = 0.0;

    my_data.num_ranges = 15;
    my_data.ranges = (0..15).collect();

    my_data.name = "example string".to_string();
    my_data.enabled = true;

    lcm.publish("EXAMPLE", &my_data);
}

--- 
+++ 
@@ -30,8 +30,5 @@
     my_data.name = "example string".to_string();
     my_data.enabled = true;
 
-    match lcm.publish("EXAMPLE", &my_data) {
-        Ok(()) => println!("Sent message."),
-        Err(e) => println!("Failed to send message: {}", e)
-    }
+    lcm.publish("EXAMPLE", &my_data);
 }
Handle return value in example.
