I am aiming to have an arrow vertically centered between two listings -- this works fine given that there is no [t]-alignment of the minipages, but with them the arrow is located at the top as well, while I want it to be located in the central vertically. Note that the [t] is wanted such that the unaligned code becomes aligned. Below is a MWE:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\begin{document}
\begin{minipage}[t]{.4\textwidth}
\begin{lstlisting}[numbers=left]
for (i in 1..n):
unaligned code
\end{lstlisting}
\end{minipage}
$\rightarrow$\hfill
\begin{minipage}[t]{.4\textwidth}
\begin{lstlisting}[numbers=left]
for (i in 1..n):
unaligned code
...
...
\end{lstlisting}
\end{minipage}
\end{document}