New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAQ refers to apparently non-existent .char_at() method #46942

Closed
mark-summerfield opened this Issue Dec 22, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@mark-summerfield
Copy link
Contributor

mark-summerfield commented Dec 22, 2017

In this file: https://www.rust-lang.org/en-US/faq.html#strings it refers to a .char_at() method. I've tried this on String and &str but according the the playpen neither has this method:

fn main() {
    let s = "Hello, world!";
    let t = s.to_string();
    println!("{}", s.char_at(5));
    println!("{}", t.char_at(5));
}
   Compiling playground v0.0.1 (file:///playground)
error[E0599]: no method named `char_at` found for type `&str` in the current scope
 --> src/main.rs:4:22
  |
4 |     println!("{}", s.char_at(5));
  |                      ^^^^^^^

error[E0599]: no method named `char_at` found for type `std::string::String` in the current scope
 --> src/main.rs:5:22
  |
5 |     println!("{}", t.char_at(5));
  |                      ^^^^^^^

error: aborting due to 2 previous errors
@frewsxcv

This comment has been minimized.

Copy link
Member

frewsxcv commented Dec 22, 2017

opened a pr for this: rust-lang/prev.rust-lang.org#993

@zackmdavis

This comment has been minimized.

Copy link
Member

zackmdavis commented Dec 23, 2017

Historian's note: char_at was deprecated in 1.9 (552eda7) and removed in 1.11 (b64c9d5).

@frewsxcv

This comment has been minimized.

Copy link
Member

frewsxcv commented Jan 4, 2018

PR merged

@frewsxcv frewsxcv closed this Jan 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment