Sha256: fac54d51189fc0b5d2bff334b7a7e465177b431e3428299e345e1f90062d832e
Contents?: true
Size: 429 Bytes
Versions: 14
Compression:
Stored size: 429 Bytes
Contents
use std::fmt; #[derive(Debug)] pub struct Filter { inner: String, } impl Filter { pub fn new(spec: &str) -> Result<Filter, String> { Ok(Filter { inner: spec.to_string(), }) } pub fn is_match(&self, s: &str) -> bool { s.contains(&self.inner) } } impl fmt::Display for Filter { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.inner.fmt(f) } }
Version data entries
14 entries across 14 versions & 1 rubygems