SHARE
TWEET

Untitled

a guest May 20th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pub fn next_after(content: &str, pos: usize) -> Option<&str> {
  2.  
  3.     let ci = content[pos..].char_indices().find(|&(i, c)| c == ' ' || c == '\n');
  4.  
  5.     match ci {
  6.         Some((i, ' ')) => {
  7.             let val = &content[pos+i+1..];
  8.  
  9.             if val.len() > 0 {
  10.                 Some(val)
  11.             } else { None }
  12.         },
  13.         _ => None
  14.     }
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top