# Result.map Example Err(..) meaning?

**URL:** <https://users.rust-lang.org/t/result-map-example-err-meaning/140205>\
**Category:** uncategorized\
**Created:** [May 21, 2026, 6:48am UTC](https://users.rust-lang.org/t/result-map-example-err-meaning/140205 "2026-05-21T06:48:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wbcat](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/wbcat/32/34223_2.png) [@wbcat](https://users.rust-lang.org/u/wbcat)\
**Post date:** [May 21, 2026, 6:48am UTC](https://users.rust-lang.org/t/result-map-example-err-meaning/140205/1 "2026-05-21T06:48:42Z")

</div>

Reading the Example for Result.map i stumbled upon the Err Variant

```rust
let line = "1\n2\n3\n4\n";

for num in line.lines() {
    match num.parse::<i32>().map(|i| i * 2) {
        Ok(n) => println!("{n}"),
        Err(..) => {}
    }
}

```

What does Err(..) mean here?  
`..` = RangeFull?

---

<div class="post-metadata">

**Author:** ![ajmull](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/ajmull/32/51096_2.png) [@ajmull](https://users.rust-lang.org/u/ajmull)\
**Post date:** [May 21, 2026, 7:11am UTC](https://users.rust-lang.org/t/result-map-example-err-meaning/140205/2 "2026-05-21T07:11:38Z")

</div>

When you parse the `str`, you create a `Result<i32, std::num::ParseIntError>`. The `Result::map` method changes the `Ok` value if it is `Ok`, and leaves `Err` untouched if not. At this point, it is still a `Result`. You match the Result, and the `..` just means "match all values. (In every field of the n-ary tuple.)" It is similar to `_`.

---

<div class="post-metadata">

**Author:** ![giocri](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/giocri/32/49821_2.png) [@giocri](https://users.rust-lang.org/u/giocri)\
**Post date:** [May 21, 2026, 7:14am UTC](https://users.rust-lang.org/t/result-map-example-err-meaning/140205/3 "2026-05-21T07:14:29Z")

</div>

.. in a few contexts means all remaining fields / all remaining members of a tuple / all remaining elements of a slice or array.

in this case Result(..) means a result variant with all of it's content ignored

---

<div class="post-metadata">

**Author:** ![nerditation](https://avatars.discourse-cdn.com/v4/letter/n/e79b87/32.png) [@nerditation](https://users.rust-lang.org/u/nerditation)\
**Post date:** [May 21, 2026, 7:45am UTC](https://users.rust-lang.org/t/result-map-example-err-meaning/140205/4 "2026-05-21T07:45:14Z")

</div>

> [@wbcat](#):
>
> `..` = RangeFull?

the `..` token here is the "rest pattern", not the range operator.

> **[Rest pattern - Patterns - The Rust Reference](https://doc.rust-lang.org/stable/reference/patterns.html#rest-pattern)**
>
> Syntax Pattern → |? PatternNoTopAlt ( | PatternNoTopAlt )\*

---

<div class="post-metadata">

**Author:** ![Kyllingene](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/kyllingene/32/33899_2.png) [@Kyllingene](https://users.rust-lang.org/u/Kyllingene)\
**Post date:** [May 21, 2026, 7:51pm UTC](https://users.rust-lang.org/t/result-map-example-err-meaning/140205/5 "2026-05-21T19:51:58Z")

</div>

I am a little curious why they used it in that example. There's still only one value in the `Err` variant, even if that value is a struct in this case. Is this a common idiom, for people to default to `..` instead of `_` since it's more general? (not that this matters much anyways)

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/system/32/51372_2.png) [@system](https://users.rust-lang.org/u/system)\
**Post date:** [August 19, 2026, 7:52pm UTC](https://users.rust-lang.org/t/result-map-example-err-meaning/140205/6 "2026-08-19T19:52:36Z")

</div>

Closed on August 19, 2026, 7:52pm UTC

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.
