Skip to content

Commit 10abcd1

Browse files
committed
update splitlab handout
1 parent d90e05b commit 10abcd1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

hw/splitlab/doc/splitlab/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<p>In this homework, you will implement functionality similar to that of the <a href="https://doc.rust-lang.org/std/primitive.str.html#method.split"><code>split</code></a> method on
88
<a href="https://doc.rust-lang.org/std/primitive.str.html"><code>str</code></a> in the Rust standard library. You will need to construct a <code>Split</code> struct that implements
99
the <a href="https://doc.rust-lang.org/1.85.0/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator"><code>Iterator</code></a> trait, where the items it yields are slices of the original string (the
10-
<code>haystack</code>), deliminated by some <code>delimiter</code>.</p>
10+
<code>haystack</code>), delimited by some <code>delimiter</code>.</p>
1111
<p>A correct solution is likely going to contain very few lines of code (~20). However, the interaction
1212
between the lifetimes and your code will probably be tricky to implement on your own.</p>
1313
<p>Instead of trying to figure this out on your own, we ask that you watch the following livestream
@@ -17,18 +17,18 @@
1717
<h2 id="notes"><a class="doc-anchor" href="#notes">§</a>Notes</h2>
1818
<p>Please don’t spend too much time on this! The goal here is to understand how lifetimes work, not how
1919
to specifically implement something that is already in the standard library.</p>
20-
<p><strong>Also, the starter code we have given you is slightly different to how Jon implements this
21-
iterator, so be aware of the difference. It is not so different that you will need to rewrite
22-
everything from scratch.</strong> You will, however, need to make some changes to the starter code in order
23-
to get things to compile (mainly removing the placeholder <code>'static</code> lifetimes).</p>
20+
<p><strong>Also, the starter code we have given you is slightly different to how Jon implements <code>Split</code>, so
21+
be aware of the difference. It is not so different that you will need to rewrite everything from
22+
scratch.</strong> You will, however, need to make some changes to the starter code in order to get things
23+
to compile (mainly removing the placeholder <code>'static</code> lifetimes).</p>
2424
<p><em>Note that Jon does not reveal how to make those compile until the end of the livestream (the
25-
“Multiple lifetimes” sections).</em></p>
25+
“Multiple lifetimes” sections). After that section, you only need to keep watching if you want to
26+
complete the extra credit in <code>src/split_pattern.rs</code>.</em></p>
2627
<p><strong>Finally, it is probably in your interest to watch the livestream <em>before</em> writing any code, as you
2728
will not need to write more than 20 lines of code, and understanding the concepts is far more
2829
important.</strong> If you try to finesse how much of the livestream you watch and how much code you write
2930
in between the sections, you will likely end up spending <strong>more</strong> time than if you just watched the
3031
entire livestream and wrote your own solution.</p>
31-
<br>
3232
<h3 id="livestream"><a class="doc-anchor" href="#livestream">§</a>Livestream</h3>
3333
<p>The livestream is 90 minutes, but you can skip several sections. We’ve listed the sections you
3434
<em>should</em> watch below (you can jump around via the chapters on YouTube). Of course, we would

hw/splitlab/splitlab.zip

465 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)