mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Move LowercaseString near its only consumer.
This commit is contained in:
parent
06a1d04ca6
commit
c2e8916168
2 changed files with 24 additions and 24 deletions
|
@ -5,7 +5,6 @@
|
|||
use num_traits::ToPrimitive;
|
||||
use std::convert::AsRef;
|
||||
use std::iter::{Filter, Peekable};
|
||||
use std::ops::Deref;
|
||||
use std::str::Split;
|
||||
|
||||
pub type StaticCharVec = &'static [char];
|
||||
|
@ -117,28 +116,6 @@ pub fn read_exponent<I: Iterator<Item=char>>(mut iter: Peekable<I>) -> Option<i3
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Eq, PartialEq, Hash, Debug, Deserialize, Serialize)]
|
||||
pub struct LowercaseString {
|
||||
inner: String,
|
||||
}
|
||||
|
||||
impl LowercaseString {
|
||||
pub fn new(s: &str) -> LowercaseString {
|
||||
LowercaseString {
|
||||
inner: s.to_lowercase(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Deref for LowercaseString {
|
||||
type Target = str;
|
||||
|
||||
#[inline]
|
||||
fn deref(&self) -> &str {
|
||||
&*self.inner
|
||||
}
|
||||
}
|
||||
|
||||
pub fn str_join<I, T>(strs: I, join: &str) -> String
|
||||
where I: IntoIterator<Item=T>, T: AsRef<str>,
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue