3

When I define the Rust language in TeX Live 2023’s lstlisting like this:

\begin{lstlisting}[language=Rust]
let config_redis_string: String = env::var("REDIS_URL").expect("redis url missing");
\end{lstlisting}

it does not seem to support the Rust language. Is it possible to add support for Rust?

Ingmar
  • 6,690
  • 5
  • 26
  • 47
Dolphin
  • 843

1 Answers1

7

Using the style from https://github.com/denki/listings-rust , the following seems to work fine:

\documentclass{article}

\usepackage{listings, listings-rust}

\begin{document}

\begin{lstlisting}[language=Rust] let config_redis_string: String = env::var("REDIS_URL").expect("redis url missing"); \end{lstlisting}

\end{document}