Skip to content

Commit d63b45f

Browse files
committed
txs auto checkin
1 parent 0889053 commit d63b45f

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

rust.tex

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,7 +1984,6 @@ \section{An I/O Project: Building a Command Line Program}
19841984
\inputminted{rust}{./code/grep5.rs}
19851985
\end{frame}
19861986
1987-
19881987
\begin{frame}[fragile]
19891988
\frametitle{minigrep - Refactoring (Creating a Constructor for Config)}
19901989
\inputminted{rust}{./code/grep6.rs}
@@ -2003,7 +2002,47 @@ \section{An I/O Project: Building a Command Line Program}
20032002
20042003
\begin{frame}[fragile]
20052004
\frametitle{minigrep - Refactoring (Extracting Logic from main)}
2006-
\inputminted{rust}{./code/grep8.rs}
2005+
\inputminted{rust}{./code/grep9.rs}
2006+
\end{frame}
2007+
2008+
\begin{frame}[fragile]
2009+
\frametitle{minigrep - Refactoring (Handling Errors Returned from run in main)}
2010+
\inputminted{rust}{./code/grep10.rs}
2011+
\end{frame}
2012+
2013+
\begin{frame}[fragile]
2014+
\frametitle{minigrep - Refactoring (Splitting Code into a Library Crate)}
2015+
Filename: \mintinline{shell}|src/lib.rs|
2016+
\inputminted{rust}{./code/grep11.rs}
2017+
\end{frame}
2018+
2019+
\begin{frame}[fragile]
2020+
\frametitle{minigrep - Refactoring (Splitting Code into a Library Crate(2))}
2021+
Filename: \mintinline{shell}|src/main.rs|
2022+
\inputminted{rust}{./code/grep12.rs}
2023+
\end{frame}
2024+
2025+
\begin{frame}[fragile]
2026+
\frametitle{minigrep - Working with Environment Variables}
2027+
\inputminted{rust}{./code/grep13.rs}
2028+
2029+
\end{frame}
2030+
2031+
\begin{frame}[fragile]
2032+
\frametitle{minigrep - Working with Environment Variables (2)}
2033+
\begin{itemize}
2034+
\item The env::var function returns a Result that will be the successful Ok variant that contains the value of the environment variable if the environment variable is set to any value. It will return the Err variant if the environment variable is not set.
2035+
\item We’re using the \mintinline{rust}|is_ok| method on the Result to check whether the environment variable is set. If the \mintinline{rust}|IGNORE_CASE| environment variable isn’t set to anything, \mintinline{rust}|is_ok| will return false.
2036+
\end{itemize}
2037+
\end{frame}
2038+
2039+
Writing Error Messages to Standard Error Instead of Standard Output
2040+
\begin{frame}[fragile]
2041+
\frametitle{minigrep - Writing Error Messages to Standard Error Instead of Standard Output}
2042+
\begin{itemize}
2043+
\item The env::var function returns a Result that will be the successful Ok variant that contains the value of the environment variable if the environment variable is set to any value. It will return the Err variant if the environment variable is not set.
2044+
\item We’re using the \mintinline{rust}|is_ok| method on the Result to check whether the environment variable is set. If the \mintinline{rust}|IGNORE_CASE| environment variable isn’t set to anything, \mintinline{rust}|is_ok| will return false.
2045+
\end{itemize}
20072046
\end{frame}
20082047
20092048
\section{Functional Language Features: Iterators and Closures}

0 commit comments

Comments
 (0)