is there a nice way to redefine \to in a LaTeX file so that it becomes \rightarrow in inline maths and \longrightarrow in display maths?

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!