mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Use ArcSlice for quotes.
This saves the intermediate allocation. Differential Revision: https://phabricator.services.mozilla.com/D30546
This commit is contained in:
parent
bbc77e3977
commit
a109fbb7c8
9 changed files with 85 additions and 44 deletions
|
@ -9,21 +9,19 @@ pub use crate::values::specified::list::ListStyleType;
|
|||
pub use crate::values::specified::list::MozListReversed;
|
||||
pub use crate::values::specified::list::{QuotePair, Quotes};
|
||||
|
||||
use servo_arc::Arc;
|
||||
|
||||
lazy_static! {
|
||||
static ref INITIAL_QUOTES: Arc<Box<[QuotePair]>> = Arc::new(
|
||||
static ref INITIAL_QUOTES: crate::ArcSlice<QuotePair> = crate::ArcSlice::from_iter(
|
||||
vec![
|
||||
QuotePair {
|
||||
opening: "\u{201c}".to_owned().into_boxed_str(),
|
||||
closing: "\u{201d}".to_owned().into_boxed_str(),
|
||||
opening: "\u{201c}".to_owned().into(),
|
||||
closing: "\u{201d}".to_owned().into(),
|
||||
},
|
||||
QuotePair {
|
||||
opening: "\u{2018}".to_owned().into_boxed_str(),
|
||||
closing: "\u{2019}".to_owned().into_boxed_str(),
|
||||
opening: "\u{2018}".to_owned().into(),
|
||||
closing: "\u{2019}".to_owned().into(),
|
||||
},
|
||||
]
|
||||
.into_boxed_slice()
|
||||
.into_iter()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue