# Add \`.rfind()\` to the \`Iterator\` trait

**URL:** <https://internals.rust-lang.org/t/add-rfind-to-the-iterator-trait/4501>\
**Category:** libs\
**Created:** [December 23, 2016, 2:58am UTC](https://internals.rust-lang.org/t/add-rfind-to-the-iterator-trait/4501 "2016-12-23T02:58:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![photino](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/photino/32/2755_2.png) [@photino](https://internals.rust-lang.org/u/photino)\
**Post date:** [December 23, 2016, 2:58am UTC](https://internals.rust-lang.org/t/add-rfind-to-the-iterator-trait/4501/1 "2016-12-23T02:58:27Z")

</div>

Since we have both `.position()` and `.rposition()`, it is reasonable to add `.rfind()` as well. For `str`, we also have both `.find()` and `.rfind()`.

---

<div class="post-metadata">

**Author:** ![bluss](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/bluss/32/2264_2.png) [@bluss](https://internals.rust-lang.org/u/bluss)\
**Post date:** [December 23, 2016, 12:28pm UTC](https://internals.rust-lang.org/t/add-rfind-to-the-iterator-trait/4501/2 "2016-12-23T12:28:52Z")

</div>

I think it’s reasonable to add both rfind and rfold and maybe more. One benefit is that the reversed versions cross over with `Rev<I>` (reversed iterators); `Rev<I>::find` calls `I`'s `rfind` and so on.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [March 25, 2019, 8:27am UTC](https://internals.rust-lang.org/t/add-rfind-to-the-iterator-trait/4501/3 "2019-03-25T08:27:32Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
