“llorendyr leapt back from the foul thing, his blade hissing where its slime still coated it.
'By the old ones! It's eating the blade!'
And it was, the fine aelwyn steel becoming dull and tarnished as the daemon's ooze fed upon the metal and magic it held...”
I cut my teeth with AD&D 1st Edition, and learned the DM's craft in a system where your items were not safe by any means. This carried on until 4e, when items pretty much got script immunity, even against such horrors as rust monsters and green slime.
In 5e, there are monsters that will eat your items, and I am sure, hazards and traps out there that can smash, dissolve or otherwise trash your gear. However, there is no unified system for determining if an item gets destroyed, and this irritates me a little.
So, here is my house rule for dealing with situations where an item may, or may not, get destroyed.
When an item is exposed to an attack or situation where it may become damaged or destroyed, it makes a saving throw in the same way a player does, adding a bonus that depends on what enchantment level it carries.
What happens on a failed save depends on the situation. An item may be temporarily useless, or malfunction until it is repaired somehow, or it may become less useful – maybe accumulating some penalty or similar. In some situations however, a failed save may mean the end of the item !