Skip to content

Commit a555eea

Browse files
committed
txs auto checkin
1 parent 5dac83c commit a555eea

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

rust.tex

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,6 +2052,34 @@ \section{An I/O Project: Building a Command Line Program}
20522052

20532053
\section{Functional Language Features: Iterators and Closures}
20542054

2055+
2056+
\begin{frame}[fragile]
2057+
\frametitle{Closures: Anonymous Functions that Capture Their Environment}
2058+
\begin{itemize}
2059+
\item Rust’s closures are \textbf{anonymous functions} you can save in a variable or pass as arguments to other functions.
2060+
\item You can create the closure in one place and then call the closure elsewhere to evaluate it in a different context.
2061+
\item Unlike functions, closures \textbf{can capture values from the scope} in which they’re defined.
2062+
\item We’ll demonstrate how these closure features allow for \textbf{code reuse} and \textbf{behavior customization}.
2063+
\end{itemize}
2064+
\end{frame}
2065+
2066+
2067+
\begin{frame}[fragile]
2068+
\frametitle{Capturing the Environment with Closures}
2069+
\begin{itemize}
2070+
\item Rust’s closures are \textbf{anonymous functions} you can save in a variable or pass as arguments to other functions.
2071+
\item You can create the closure in one place and then call the closure elsewhere to evaluate it in a different context.
2072+
\item Unlike functions, closures \textbf{can capture values from the scope} in which they’re defined.
2073+
\item We’ll demonstrate how these closure features allow for \textbf{code reuse} and \textbf{behavior customization}.
2074+
\end{itemize}
2075+
\end{frame}
2076+
2077+
\begin{frame}[fragile]
2078+
\frametitle{Closure Type Inference and Annotation}
2079+
\inputminted{rust}{./code/closure.rs}
2080+
\end{frame}
2081+
2082+
20552083
\section{More About Cargo and Crates.io}
20562084
\section{Smart Pointers}
20572085
\section{Fearless Concurrency}

0 commit comments

Comments
 (0)