From a500d1e3cc10b4307b9ee86cc924fec86f7b53b1 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Wed, 25 Sep 2019 18:24:32 +0200 Subject: [PATCH] Fix things --- .../undefined-behaviour-it.rs | 14 ++++++-------- .../dash-3d-implementation/undefined-behaviour.rs | 8 +++----- src/dash-3d-implementation/introduction.tex | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/assets/dash-3d-implementation/undefined-behaviour-it.rs b/assets/dash-3d-implementation/undefined-behaviour-it.rs index b31aad4..05b0a1d 100644 --- a/assets/dash-3d-implementation/undefined-behaviour-it.rs +++ b/assets/dash-3d-implementation/undefined-behaviour-it.rs @@ -1,10 +1,8 @@ -fn func() { - let mut vec = vec![1, 2, 3]; - let iter = vec.iter(); - loop { - match iter.next() { - Some(x) => vec.push(x), - None => break, - } +let mut vec = vec![1, 2, 3]; +let iter = vec.iter(); +loop { + match iter.next() { + Some(x) => vec.push(x), + None => break, } } diff --git a/assets/dash-3d-implementation/undefined-behaviour.rs b/assets/dash-3d-implementation/undefined-behaviour.rs index 0013191..da2bec3 100644 --- a/assets/dash-3d-implementation/undefined-behaviour.rs +++ b/assets/dash-3d-implementation/undefined-behaviour.rs @@ -1,6 +1,4 @@ -fn func() { - let mut vec = vec![1, 2, 3]; - for value in &vec { - vec.push(value); - } +let mut vec = vec![1, 2, 3]; +for value in &vec { + vec.push(value); } diff --git a/src/dash-3d-implementation/introduction.tex b/src/dash-3d-implementation/introduction.tex index 48b45dd..1c17973 100644 --- a/src/dash-3d-implementation/introduction.tex +++ b/src/dash-3d-implementation/introduction.tex @@ -33,7 +33,7 @@ Consider the piece of C++ code in Listings~\ref{d3i:undefined-behaviour-cpp} and \begin{figure}[ht] \centering - \begin{minipage}[c]{0.75\textwidth} + \begin{minipage}[c]{0.85\textwidth} \lstinputlisting[ language=c++, label={d3i:undefined-behaviour-cpp},