Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

No type hint after .filter() #277

@0x7CFE

Description

@0x7CFE

My code contains some FP-style transformations on the string slice.

I've noticed that the following code snippet is not parsed completely. RLS provides type hints for split filter and e and x inside the closures, but all remaining tokens such as collect or map are not parsed.

let slice = "\"1,2,3,,4\"";

let result: Vec<i32> = slice[1 .. slice.len()-1] // strip quotes
    .split(',')
    .filter(|e| e.len() > 0) // a,,b
    .map(|x| x.parse().map_err(|_| "parse error"))
    .collect::<Result<_,_>>()
    .unwrap()

I use latest versions both for Rustc and RLS.

rustc 1.18.0-nightly (2b4c91158 2017-04-25)
binary: rustc
commit-hash: 2b4c911581099e247a68b3a8adc782d778f5190b
commit-date: 2017-04-25
host: x86_64-unknown-linux-gnu
release: 1.18.0-nightly
LLVM version: 4.0

HEAD from the RLS repository:

commit 7599a6f8fee46ac96bde8d0be4ea99d56bb01510
Author: Jonathan Turner <[email protected]>
Date:   Wed Apr 26 14:59:28 2017 +1200

    Update README.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions