mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Use more Box<[]> and Box<str> for quotes.
This commit is contained in:
parent
16f627a18a
commit
03f3521216
5 changed files with 50 additions and 31 deletions
|
@ -7,12 +7,20 @@
|
|||
pub use values::specified::list::Quotes;
|
||||
|
||||
impl Quotes {
|
||||
/// Initial value for `quotes`
|
||||
/// Initial value for `quotes`.
|
||||
///
|
||||
/// FIXME(emilio): This should ideally not allocate.
|
||||
#[inline]
|
||||
pub fn get_initial_value() -> Quotes {
|
||||
Quotes(vec![
|
||||
("\u{201c}".to_owned(), "\u{201d}".to_owned()),
|
||||
("\u{2018}".to_owned(), "\u{2019}".to_owned()),
|
||||
])
|
||||
(
|
||||
"\u{201c}".to_owned().into_boxed_str(),
|
||||
"\u{201d}".to_owned().into_boxed_str(),
|
||||
),
|
||||
(
|
||||
"\u{2018}".to_owned().into_boxed_str(),
|
||||
"\u{2019}".to_owned().into_boxed_str(),
|
||||
),
|
||||
].into_boxed_slice())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue