Elf M. Sternberg
e654c7d8e5
This block is confused.
...
Consider the following demonstration (this code compiles under Rust 2018
as a drop in for the contents of main.rs after `cargo new mapdemo --bin;
cargo run`):
```
fn main() {
let x = [1, 2, 3, 4, 5];
let z = x.iter().map(|&x| format!("{}", x)).collect::<Vec<String>>();
println!("{:?}", z);
}
```
The `self` argument to map will be an `Iter<u64>`. The `Self::Item`
type is therefore `u64`. The return type of the function being passed
to map is `String`. This is what the `B` type variable indicates: the
return type of the function, as can be clearly seen in the second line
of the `where` clause in your example:
```
F: FnMut(Self::Item) -> B
```
2020-07-29 14:29:00 -07:00
patahene
f592f662e4
Update README.md
2020-07-30 06:25:05 +09:00
Zyf
3b8d5057d6
Fix shadowing example
2020-07-29 21:57:24 +02:00
Arcadie
583281f2d5
Use emojis to ignore snippets that won't compile / code fragments.
...
I did a search and replace for:
// (note: this will not compile) incomplete code snippet -> // ⚠️
// (note: this will not compile) -> // 🚧
Note: Requires md2src version 1.1.0 or later!
2020-07-29 22:13:34 +03:00
Dhghomon
cddf839e32
Default + builder pattern
2020-07-29 14:33:43 +09:00
Arcadie
192047be94
Delete whitespace, tweak phrasing
2020-07-28 17:10:15 +03:00
Arcadie
9e9bf0a265
Arc: when spanwing threads in a loop, call join on handlers at the end
2020-07-28 17:01:43 +03:00
Arcadie
27def910d6
Mutex: fix output for code samples
2020-07-28 17:01:43 +03:00
Arcadie
a1f511f80f
Generics - fix print with, specify variables of type U
2020-07-28 17:01:43 +03:00
Arcadie
c56888fcf5
VecDeque - say items are moved instead of copied on remove()
2020-07-28 17:01:43 +03:00
Dhghomon
0dc4a75139
chars, len(), chars().count()
2020-07-28 20:20:40 +09:00
Arcadie
e773c679bd
Impl Trait - make snippets compile by fixing ignore message
2020-07-28 12:25:41 +03:00
Arcadie
3263dce437
Fix small typo in filter_map() example, get rid of into_iter() for range.
...
Range already implements Iterator trait, so no need for the into_iter().
2020-07-28 12:12:13 +03:00
Dhghomon
fafdb36cec
Rewrite a bit
2020-07-28 16:29:55 +09:00
Dhghomon
613a9755f0
impl Trait
2020-07-28 15:26:25 +09:00
Dhghomon
36a056df85
Closures in functions
2020-07-28 08:57:33 +09:00
Dhghomon
8fb5b1e131
Explanation of what a snippet is
2020-07-28 07:31:44 +09:00
Alexander Willner
8c0d7a3b79
getting all code snippets to compile or to be skipped
2020-07-27 20:40:50 +02:00
Alexander Willner
27f0d7ad45
getting the first 50 code snippets to compile or to be skipped
2020-07-27 17:46:51 +02:00
Alexander Willner
6f0ed2ae75
Started to get snippets compile / mark them as uncompilable...
2020-07-27 16:22:45 +02:00
Alexander Willner
1cf4605343
Mark snippet as no compilable
2020-07-27 15:23:54 +02:00
Dhghomon
a39f09850a
Some other methods
2020-07-27 19:36:21 +09:00
Dhghomon
56afb860af
.cycle()
2020-07-27 19:24:01 +09:00
Dhghomon
33705b94ba
.find(), .position()
2020-07-27 16:19:27 +09:00
Dhghomon
b62700abae
.any(), .all()
2020-07-27 14:24:24 +09:00
Dhghomon
ef187d51ba
.and_then(), .and()
2020-07-27 13:20:11 +09:00
Dhghomon
e9fdd53a7e
ok_or + ok_or_else
2020-07-27 12:06:08 +09:00
Dhghomon
4ac9f67713
Fix typo
2020-07-27 11:35:24 +09:00
Dhghomon
c4cb3c1ac1
More on closures + iterators
2020-07-26 23:47:06 +09:00
Dhghomon
516556fb5f
VecDeque
2020-07-26 19:12:39 +09:00
Dhghomon
9f9c7484c7
BinaryHeap
2020-07-26 18:10:52 +09:00
Dhghomon
e7f9b6d27c
Start HashSet + BTreeSet
2020-07-26 17:21:28 +09:00
Suresh G
e2ffd92ff1
Update README.md
...
spell changes
2020-07-26 12:29:46 +05:30
Dhghomon
17a9c09880
[] vs. .get() for HashMap
2020-07-26 13:33:19 +09:00
Dhghomon
6ccb798ce3
More on hashmaps
2020-07-26 13:06:13 +09:00
byschii
1f59c6b710
Typo
2020-07-25 18:18:55 +02:00
Dhghomon
3851cb54b9
Typo
2020-07-26 00:58:01 +09:00
Dhghomon
218a193dcf
Typo
2020-07-26 00:51:44 +09:00
Dhghomon
8e316f7402
More on r# and unicode escape
2020-07-26 00:50:45 +09:00
Dhghomon
75eb5a9194
correction
2020-07-26 00:27:33 +09:00
Dhghomon
3b337b533a
Add intro
2020-07-26 00:25:58 +09:00
Pradeep Chauhan
4d3f5a1c08
Merge branch 'master' into fix-typos
2020-07-25 20:33:21 +05:30
Pradeep Chauhan
4ee6006e8c
Fix typos
2020-07-25 20:19:35 +05:30
Dhghomon
b23782290f
.zip() and .collect() into HashMap
2020-07-25 21:02:55 +09:00
Dhghomon
6243d39632
Start HashMap
2020-07-25 20:42:36 +09:00
Dhghomon
4ea46d54d8
Commas in structs
2020-07-25 20:18:25 +09:00
Dhghomon
f78d86b5c9
More on printing
2020-07-25 20:06:22 +09:00
Dhghomon
3c4237acd8
Correction
2020-07-25 15:32:02 +09:00
Dhghomon
91b0f71685
Start adding to printing
2020-07-25 15:31:03 +09:00
Sudo Nice
725ea14d80
Fix misleading Self explanation
...
closes #21
2020-07-25 07:51:08 +03:00
Dhghomon
deaec92cbb
Slight reword
2020-07-25 11:39:54 +09:00
Alexander Willner
fa0f6ea8cd
Fixing Markdownlint: various fixes
2020-07-24 22:44:20 +02:00
Alexander Willner
a8c88b7654
Fixing Markdownlint MD025: single h1
2020-07-24 22:39:57 +02:00
Alexander Willner
f723508cc1
Fixing Markdownlint MD012: multiple blanks
2020-07-24 22:37:46 +02:00
Alexander Willner
ddd6ccdda2
Fixing Markdownlint MD040: missed language definition
2020-07-24 22:34:23 +02:00
Alexander Willner
64622938fb
Fixing Markdownlint MD004: unordered lists
2020-07-24 22:26:55 +02:00
Alexander Willner
fdd687471f
Fixing Markdownlint MD034: links
2020-07-24 22:25:51 +02:00
Alexander Willner
ab9d4b6e91
removed compiler warnings
2020-07-24 22:08:26 +02:00
Arcadie
5ad66fff91
Fix output for 'Enums to use multiple types'
2020-07-24 19:21:52 +03:00
Dhghomon
86042e07ca
Merge pull request #22 from Naereen/patch-1
...
Tiny typo: varible -> variable
2020-07-24 23:28:48 +09:00
Dhghomon
c47998dd23
Start Box
2020-07-24 23:28:24 +09:00
Lilian Besson
ccd6403945
Tiny typo: varible -> variable
...
Hi,
First, bravo, great job done here!
Then, I saw this tiny typo: varible -> variable.
Regards
2020-07-24 15:04:20 +02:00
Dhghomon
d46e8b7db9
One more example of why multiple numeric types
2020-07-24 18:51:01 +09:00
Dhghomon
76ea9f792d
Implementing the From trait
2020-07-24 14:33:57 +09:00
Dhghomon
461d8c293b
Traits in documentation + redo enum example
...
Enum example takes place before introducing attributes so small change to make #[derive(Debug)] unnecessary
2020-07-24 13:13:23 +09:00
Dhghomon
3cb4b92810
Merge pull request #19 from maxzinkus/patch-1
...
Fix typo
2020-07-24 12:43:48 +09:00
Michael Howell
1bf0dd5aaa
Replace SkyState
with ThingsInTheSky
...
Looks like you missed one.
2020-07-23 12:48:35 -07:00
Max Zinkus
f342922395
Fix typo
2020-07-23 14:26:42 -04:00
Dhghomon
7e723b2cff
Pointer address
2020-07-24 01:39:32 +09:00
pretzelhammer
b9f15b6018
improves code formatting
2020-07-23 11:55:53 -04:00
Dhghomon
a82e194506
Actually, two sentences could work
2020-07-24 00:42:39 +09:00
Jacob
0d384b0def
adds missing curly braces, inline code formatting in Multiple threads
2020-07-23 10:17:03 -05:00
Dhghomon
d6178a45c1
Correction on .into
2020-07-23 23:35:27 +09:00
Sudo Nice
98859f2982
Merge remote-tracking branch 'upstream/master'
2020-07-23 16:59:13 +03:00
Dhghomon
7f0490f435
Delete incorrect paragraph
2020-07-23 22:51:56 +09:00
Sudo Nice
0075ab0d1f
Replace code block surrounding '``' -> '
' for inlined code
...
closes #7
2020-07-23 16:51:17 +03:00
Dhghomon
8619fb81d8
Expand on reference explanation
2020-07-23 22:36:32 +09:00
Dhghomon
4f60ee5c23
Small fixes + finish incompllete paragraph
2020-07-23 22:32:08 +09:00
ambiso
0bf6f280c4
Fix type aliases
2020-07-23 14:52:48 +02:00
Sudo Nice
2cb43c9b60
Fix code blocks formatting
2020-07-23 15:40:29 +03:00
Sudo Nice
7a5b5fa48b
Fix wording
2020-07-23 14:55:14 +03:00
Sudo Nice
e571353276
Fix spaces
2020-07-23 14:55:14 +03:00
Sudo Nice
7bd21adee9
Slightly precise (yet simple) wording
2020-07-23 13:31:53 +03:00
Dhghomon
4c4ddfe02e
Reading Rust documents
2020-07-23 19:14:29 +09:00
Dhghomon
9b6585963d
Tiny rewording
2020-07-23 18:56:20 +09:00
Dhghomon
cbff1b12c0
Merge pull request #4 from ridiculousfish/unicode_tightening
...
Tighten up some language around ASCII
2020-07-23 18:54:24 +09:00
ridiculousfish
2490824036
Tighten up some language around ASCII
...
This commit attempts to clarify some language around char. It drops
mentions of ASCII and tries to make the language around u8<->char
more clear.
2020-07-23 02:29:22 -07:00
Dhghomon
4048fcb6fe
Add inclusive range syntax (..=)
2020-07-23 18:15:58 +09:00
Dhghomon
07568b0d08
reorder that
2020-07-23 17:36:19 +09:00
Dhghomon
53036e7274
See if this makes a table of contents
2020-07-23 17:35:42 +09:00
Hasan
10d126b313
Fix RC header
2020-07-23 00:15:50 -07:00
Dhghomon
ae10226d20
Rephrase that
2020-07-23 15:14:01 +09:00
Dhghomon
01cb607a37
Enums to trick the compiler
2020-07-23 15:12:18 +09:00
Dhghomon
5fc2662967
Merge pull request #1 from sudo-nice/master
...
Some quick fixes
2020-07-23 14:13:20 +09:00
Sudo Nice
20466302ac
Fix two arrays type comparison
2020-07-23 08:05:14 +03:00
Sudo Nice
5307d4aa32
Fix a typo
2020-07-23 08:02:54 +03:00
Sudo Nice
7476860f66
Fix formatting
2020-07-23 07:52:53 +03:00
Dhghomon
e8bc11061f
Some more on match
2020-07-23 13:41:56 +09:00
Dhghomon
f13cb9bf5a
More on match
2020-07-23 13:20:25 +09:00
Dhghomon
4ff4bf0824
Add Cow
2020-07-22 21:21:22 +09:00
Dhghomon
9494af328e
Channels
2020-07-22 20:28:40 +09:00
Dhghomon
8b7797700f
vec of join handles
2020-07-22 12:43:13 +09:00
Dhghomon
8bc9f4ea41
Add note
2020-07-22 12:31:56 +09:00
Dhghomon
6fb8806bb4
Arc Mutex in threads
2020-07-22 12:30:56 +09:00
Dhghomon
987a30dbe5
Rephrase a bit
2020-07-22 11:13:12 +09:00
Dhghomon
00876e5148
Move dot operator to under Struct intro
2020-07-21 20:10:40 +09:00
Dhghomon
42c7a7b2eb
Destructuring
2020-07-21 20:09:05 +09:00
Dhghomon
8399f6f6cd
Adding value after break
2020-07-21 19:08:58 +09:00
Dhghomon
b37bd7bb5f
Unitialized variables
2020-07-21 18:59:10 +09:00
Dhghomon
ccfe1e578f
More on lifetimes
2020-07-21 15:00:36 +09:00
Dhghomon
9bfa3a92e1
.into() for vecs
2020-07-21 14:13:27 +09:00
Dhghomon
af47700b6a
Ways to make a String
2020-07-21 14:09:06 +09:00
Dhghomon
91e3cdf0f7
Implementing AsRef<str>
2020-07-21 13:51:06 +09:00
Dhghomon
4a3a0e9450
Start multiple threads
2020-07-20 13:31:26 +09:00
Dhghomon
a5ad0d7b4a
|_| in closures
2020-07-20 12:28:02 +09:00
Dhghomon
e3b81c7815
Start RwLock
2020-07-20 12:13:02 +09:00
Dhghomon
44cfcfed9c
Start RefCell, Mutex
2020-07-20 11:54:56 +09:00
Dhghomon
771d5860db
Start Rc
2020-07-19 18:58:05 +09:00
Dhghomon
c9f9f55dab
+ u32 for unsigned integers
2020-07-19 15:25:58 +09:00
Dhghomon
1108a85a57
Typo
2020-07-19 00:57:12 +09:00
Dhghomon
b25dcfab5f
todo! macro
2020-07-18 22:49:10 +09:00
Dhghomon
38475d6b90
Minor rewriting
2020-07-18 21:39:02 +09:00
Dhghomon
4047f77821
Minor rewriting
2020-07-18 21:26:11 +09:00
Dhghomon
749f165f1b
Small rewrites
2020-07-18 21:17:55 +09:00
Dhghomon
62e5da1cd8
Format a bit
2020-07-18 20:22:21 +09:00
Dhghomon
01f656125b
Type aliases and importing enums
2020-07-18 20:20:45 +09:00
Dhghomon
b734b2e35e
Start interior mutability
2020-07-18 15:29:10 +09:00
Dhghomon
36d35d1c6a
Implementing Iterator
2020-07-18 14:35:27 +09:00
Dhghomon
f7d824ae48
More on iterators
2020-07-17 19:28:26 +09:00
Dhghomon
bd5d71191a
Types of &str, start lifetimes
2020-07-17 13:35:31 +09:00
Dhghomon
3f2c648379
dbg! and .inspect
2020-07-17 12:21:33 +09:00
Dhghomon
2230d16d6b
Dot operator
2020-07-17 11:46:02 +09:00
Dhghomon
8e0e2889ba
const and static
2020-07-16 23:53:50 +09:00
Dhghomon
c3faf24c10
More on closures and iterators
2020-07-16 23:12:15 +09:00
Dhghomon
22def99013
Rewrite a bit
2020-07-16 21:46:26 +09:00
Dhghomon
d63c018e35
Code blocks in closures
2020-07-16 14:47:55 +09:00
Dhghomon
2cfe5e055d
Start functional style and closures
2020-07-16 14:20:03 +09:00
Dhghomon
d96f7c2d89
Move up
2020-07-16 13:29:09 +09:00
Dhghomon
7d23695084
More on unwrap, etc.
2020-07-16 13:24:25 +09:00
Dhghomon
516a56575a
panic! macro
2020-07-15 20:22:56 +09:00
Dhghomon
de2764f528
Question mark operator
2020-07-15 19:55:13 +09:00
Dhghomon
3a62e33858
if let, while let
2020-07-15 15:49:45 +09:00
Dhghomon
9815c246f8
impl Display example
2020-07-15 13:32:44 +09:00
Dhghomon
22f7881799
Start traits
2020-07-15 13:08:27 +09:00
Dhghomon
a7c026d38f
Start Result
2020-07-15 11:55:37 +09:00
Dhghomon
cb1373fc12
Start Option
2020-07-15 10:57:10 +09:00
Dhghomon
d91f518aac
More on generics
2020-07-14 15:36:08 +09:00
Dhghomon
04f2aff3c8
Start generics
2020-07-14 14:52:20 +09:00
Dhghomon
b36125902d
Start impl blocks
2020-07-14 13:50:24 +09:00
Dhghomon
52f6dbc4bf
Start enums
2020-07-14 13:20:49 +09:00
Dhghomon
093c240743
Start loops
2020-07-14 12:07:57 +09:00
Dhghomon
5b78bd21de
More on Copy types
2020-07-14 11:32:08 +09:00
Dhghomon
08852b66e6
Start structs
2020-07-13 15:21:38 +09:00
Dhghomon
1cdb0f9fc0
Start control flow
2020-07-13 14:55:22 +09:00
Dhghomon
9f9fa8c342
Vecs, tuples
2020-07-13 13:13:47 +09:00
Dhghomon
69dfecf66d
Start vecs
2020-07-12 23:35:56 +09:00
Dhghomon
3cac277a6d
+ taking ownership and adding mut
2020-07-12 17:18:40 +09:00
Dhghomon
3dd7241b0c
More formatting
2020-07-12 17:03:36 +09:00
Dhghomon
db3f84bd74
More on printing
2020-07-12 15:37:59 +09:00
Dhghomon
86b544df30
Chars, arrays
2020-07-12 14:23:17 +09:00
Dhghomon
519566411f
+ Arrays
2020-07-12 13:51:42 +09:00
Dhghomon
b55b0b862d
Reference rules, more on shadowing
2020-07-12 13:11:30 +09:00
Dhghomon
8fc6c5adc8
References
2020-07-12 12:44:44 +09:00
Dhghomon
64da3b20b4
Start stack, heap, etc.
2020-07-12 12:07:10 +09:00
Dhghomon
71ed0d1939
More on functions
2020-07-12 10:19:29 +09:00
Dhghomon
a603dee738
Typos
2020-07-12 00:46:42 +09:00
Dhghomon
90d58048c0
Mutability
2020-07-12 00:39:58 +09:00
Dhghomon
41c60ba349
Floats, more display
2020-07-11 17:21:24 +09:00
Dhghomon
7d95b0effe
Start display
2020-07-11 16:39:42 +09:00
Dhghomon
931caade8a
Hello world
2020-07-11 15:58:47 +09:00
Dhghomon
8a510fe980
Start book
2020-07-11 15:20:55 +09:00
Dhghomon
347be2cca7
Initial commit
2020-07-11 14:54:07 +09:00