What rhetorical techniques are used in the desert sand is like snow and the moon in Yanshan is like a hook?

These two sentences are dual. Duality means that two sentences have the same number of words and similar structures to express related or opposite meanings, thereby enhancing the language effect. "Desert" versus "Yanshan", "Sand Like Snow" versus "Moon Like a Hook".

At the same time, metaphors are used in each sentence. Compare the sand in the desert to snow and the moon in Yanshan Mountain to a hook.