commit 161198090377c4f281b978f538609ee3ce6190b9
parent 82217b11787fd57a47e3bda301abc0f60c66255d
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date: Sat, 27 Apr 2019 08:43:12 -0400
Correct typos and keep consistent usage of function names
Diffstat:
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/content/posts/2019-04-27-enumerate-with-c-plus-plus.en.md b/content/posts/2019-04-27-enumerate-with-c-plus-plus.en.md
@@ -7,14 +7,14 @@ date = 2019-04-27
slug = "enumerate-with-c-plus-plus"
+++
-Quite a few programming languages provide ways to iterating through a container while keeping count of the number of steps taken, such as `enumerate` in Python:
+Quite a few programming languages provide ways to iterate through a container while keeping count of the number of steps taken, such as `enumerate()` in Python:
```python
for i, elem in enumerate(v):
print(i, elem)
```
-and `enumerate` under `std::iter::Iterator` trait in Rust:
+and `enumerate()` under `std::iter::Iterator` trait in Rust:
```rust
for (i, elem) in v.iter().enumerate() {
diff --git a/org/2019.org b/org/2019.org
@@ -124,12 +124,12 @@ Here's to another spectacular 2.9e+17 radiation periods of Caesium-133!
:EXPORT_FILE_NAME: 2019-04-27-enumerate-with-c-plus-plus.en.md
:END:
-Quite a few programming languages provide ways to iterating through a container while keeping count of the number of steps taken, such as =enumerate= in Python:
+Quite a few programming languages provide ways to iterate through a container while keeping count of the number of steps taken, such as =enumerate()= in Python:
#+BEGIN_SRC python
for i, elem in enumerate(v):
print(i, elem)
#+END_SRC
-and =enumerate= under =std::iter::Iterator= trait in Rust:
+and =enumerate()= under =std::iter::Iterator= trait in Rust:
#+BEGIN_SRC rust
for (i, elem) in v.iter().enumerate() {
println!("{}, {}", i, elem);