Characterization of rare-earth conversion films formed on the AZ31 magnesium alloy and its relation with corrosion protection