fn emit_warning_contract_variables(variable: &ast::Variable) -> Option<Diagnostic> {
    if variable.assigned && !variable.read {
        return Some(Diagnostic::warning(
            variable.loc,
            format!(
                "storage variable ‘{}‘ has been assigned, but never read",
                variable.name
            ),
        ));
    } else if !variable.assigned && !variable.read {
        return Some(Diagnostic::warning(
            variable.loc,
            format!("storage variable ‘{}‘ has never been used", variable.name),
        ));
    }

    //Solidity attributes zero value to contract values that have never been assigned
    //There is no need to raise warning if we use them, as they have a valid value.

    None
}
/// Emit warnings depending on the storage variable usage
Emit warnings depending on the storage variable usage
Emit warnings depending on the storage variable usage
fn emit_warning_contract_variables(variable: &ast::Variable) -> Option<Diagnostic> {
    if variable.assigned && !variable.read {
        return Some(Diagnostic::warning(
            variable.loc,
            format!(
                "storage variable ‘{}‘ has been assigned, but never read",
                variable.name
            ),
        ));
    } else if !variable.assigned && !variable.read {
        return Some(Diagnostic::warning(
            variable.loc,
            format!("storage variable ‘{}‘ has never been used", variable.name),
        ));
    }
    //Solidity attributes zero value to contract values that have never been assigned
    //There is no need to raise warning if we use them, as they have a valid value.
    None
}
fn emit_warning_contract_variables ( variable : & ast :: Variable ) -> Option < Diagnostic > { if variable . assigned && ! variable . read { return Some ( Diagnostic :: warning ( variable . loc , format ! ( " variable name ) , ) ) ; } else if ! variable . assigned && ! variable . read { return Some ( Diagnostic :: warning ( variable . loc , format ! ( " a able.nam ), ) ) ; } //Solidity attributes zero value to contract values that have never been assigned //There is no need to raise warning if we use them, as they have a valid value. None }
Emit warnings depending on the storage variable usage
Emit warnings depending on the storage variable usage
variable
&ast::Variable
variable
&ast::Variable