You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-2Lines changed: 14 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,22 @@
3
3
[](https://gitter.im/rust-practise-questions/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
<p>Use pattern matching to find that whether a point lies on X-Axis, Y-Axis or on which quadrant.</p>
316
316
</li>
317
317
<li>
318
-
<p>Create a struct that holds info about a gun(gun type, recoil time, magazine size, extra) where <code>gun type</code> and <code>extra</code> are enums and <code>extra</code> contains silencer, scope, extended mags nad <code>None</code>.<br/>
318
+
<p>Create a struct that holds info about a gun(gun type, recoil time, magazine size, extra) where <code>gun type</code> and
319
+
<code>extra</code> are enums and <code>extra</code> contains silencer, scope, extended mags nad <code>None</code>.<br/>
319
320
Based on user input change the value of extra (may cause change in recoil time and magazine size).</p>
320
321
</li>
321
322
<li>
322
323
<p>Create a Binary tree and have a method <code>add</code> on it to add elements to it and <code>min</code> and <code>max</code> to find the minimum and maximum element in it.</p>
323
324
</li>
325
+
<li>
326
+
<p>Create a <code>Regex</code> to extract dates from this string <code>It was on 2019-03-14, almost after a year from 2018-02-11</code> and store in a
327
+
Struct with fields of <code>day</code>, <code>month</code> and <code>year</code>.
328
+
<code>hint:</code> Use <code>Regex</code> crate</p>
329
+
</li>
324
330
</ul>
325
331
<aclass="header" href="#chapter-5---traits--generics" id="chapter-5---traits--generics"><h1>Chapter 5 - Traits & Generics</h1></a>
<p>Write a generic function name <code>Multiply</code> that multiplies all <code>usize</code>, <code>isize</code> and <code>fsize</code> type values.</p>
358
364
</li>
359
365
<li>
360
-
<p>Make a generic function to return the greater of the 2 given values</p>
366
+
<p>Make a generic function to return the greater of the 2 given values (integer and floats).</p>
367
+
</li>
368
+
<li>
369
+
<p>Implement a trait named <code>Hello</code> with a default function <code>say(&self)</code> that prints <code>Hello, <self>!</code>
370
+
, Implement this for <code>str</code> and <code>string</code> without providing any definition of <code>Hello</code> (simply <code>impl Hello for str {}</code>)
371
+
call <code>say</code> on str <code>World</code>.</p>
Copy file name to clipboardExpand all lines: src/chapter_4-enum&patterns/questions.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,12 @@
17
17
18
18
* Use pattern matching to find that whether a point lies on X-Axis, Y-Axis or on which quadrant.
19
19
20
-
* Create a struct that holds info about a gun(gun type, recoil time, magazine size, extra) where `gun type` and `extra` are enums and `extra` contains silencer, scope, extended mags nad `None`.\
20
+
* Create a struct that holds info about a gun(gun type, recoil time, magazine size, extra) where `gun type` and
21
+
`extra` are enums and `extra` contains silencer, scope, extended mags nad `None`.\
21
22
Based on user input change the value of extra (may cause change in recoil time and magazine size).
22
23
23
-
* Create a Binary tree and have a method `add` on it to add elements to it and `min` and `max` to find the minimum and maximum element in it.
24
+
* Create a Binary tree and have a method `add` on it to add elements to it and `min` and `max` to find the minimum and maximum element in it.
25
+
26
+
* Create a `Regex` to extract dates from this string `It was on 2019-03-14, almost after a year from 2018-02-11` and store in a
0 commit comments