fn ignore_parts_with_underscore() {
    let mut setting_value = Some(5);
    let new_setting_value = Some(10);

    // We don't need to match on or use the values inside either Some variant, but
    // we do need to test for the case when setting_value and new_setting_value are
    // the "Some" variant.
    match (setting_value, new_setting_value) {
        (Some(_), Some(_)) => {
            println!("Can't overwrite an existing customized value");
        }
        _ => {
            setting_value = new_setting_value;
        }
    }

    println!("setting is {:?}", setting_value);

    let numbers = (2, 4, 8, 16, 32);

    match numbers {
        (first, _, third, _, fifth) => {
            println!("Some numbers: {}, {}, {}", first, third, fifth)
        }
    }
}
// Using an underscore within patterns that match Some variants when we don't need
// to use the value inside the Some.
Using an underscore within patterns that match Some variants when we don't need
to use the value inside the Some.
Using an underscore within patterns that match Some variants when we don ' t need to use the value inside the Some .
fn ignore_parts_with_underscore() {
    let mut setting_value = Some(5);
    let new_setting_value = Some(10);
    // We don't need to match on or use the values inside either Some variant, but
    // we do need to test for the case when setting_value and new_setting_value are
    // the "Some" variant.
    match (setting_value, new_setting_value) {
        (Some(_), Some(_)) => {
            println!("Can't overwrite an existing customized value");
        }
        _ => {
            setting_value = new_setting_value;
        }
    }
    println!("setting is {:?}", setting_value);
    let numbers = (2, 4, 8, 16, 32);
    match numbers {
        (first, _, third, _, fifth) => {
            println!("Some numbers: {}, {}, {}", first, third, fifth)
        }
    }
}
fn ignore_parts_with_underscore ( ) { let mut setting_value = Some ( 5 ) ; let new_setting_value = Some ( 10 ) ; // We don't need to match on or use the values inside either Some variant, but // we do need to test for the case when setting_value and new_setting_value are // the "Some" variant. match ( setting_value , new_setting_value ) { ( Some ( _ ) , Some ( _ ) ) => { println ! ( " " ) ; } _ => { setting_value = new_setting_value ; } } println ! ( " " setting_value ) ; let numbers = ( 2 , 4 , 8 , 16 , 32 ) ; match numbers { ( first , _ , third , _ , fifth ) => { println ! ( " " first third fifth ) } } }
Using an underscore within patterns that match Some variants when we don't need
to use the value inside the Some.
Using an underscore within patterns that match Some variants when we don ' t need to use the value inside the Some .