[][src]Trait no_comment::IntoWithoutComments

pub trait IntoWithoutComments where
    Self: Sized + Iterator<Item = char>, 
{ fn without_comments(self, language: Box<[Comment]>) -> WithoutComments<Self> { ... } }

A trait to implement the without_comments method on all Iterator<Item=char>

Provided methods

fn without_comments(self, language: Box<[Comment]>) -> WithoutComments<Self>

Returns a WithoutComments iterator containing self

Arguments

  • language - A boxed slice containing all the comments that the returned iterator will be removing

Example

use no_comment::{IntoWithoutComments, languages};
let with_comments = "S/*he */be/*lie*/ve//d";
let without_comments = with_comments
    .chars()
    .without_comments(languages::rust())
    .collect::<String>();
assert_eq!(&without_comments, "Sbeve");
Loading content...

Implementors

impl<I: Iterator<Item = char>> IntoWithoutComments for I[src]

Blanket implementation

Loading content...