Are you sure? Rain damages one item maximum per instance. So if something equipped rusts, no items in your backpack will rust. The code really appears correct.
I cannot get a character with nothing equipped and iron items and scrolls in the backpack to suffer any water damage, even after thousands of turns spent in the rain. Rainy save attached, in case it's helpful.