mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Make DOMString a newtype around String, rather than a typedef.
This should make it somewhat easier to experiment with alternative representations in the future. To reduce churn, this commit leaves the String field public, though. Also, this will allow us to use the default String type to represent the IDL USVString type, which explicitly forbids unpaired surrogates, ans as such is a better match to the Rust String type.
This commit is contained in:
parent
e6aa976462
commit
6b75078503
83 changed files with 393 additions and 297 deletions
|
@ -35,7 +35,7 @@ use std::mem::{size_of, transmute};
|
|||
use std::rc::Rc;
|
||||
use std::result::Result;
|
||||
use std::sync::Arc;
|
||||
use str::LengthOrPercentageOrAuto;
|
||||
use str::{DOMString, LengthOrPercentageOrAuto};
|
||||
use string_cache::atom::Atom;
|
||||
use string_cache::namespace::Namespace;
|
||||
use url;
|
||||
|
@ -101,6 +101,12 @@ impl HeapSizeOf for String {
|
|||
}
|
||||
}
|
||||
|
||||
impl HeapSizeOf for DOMString {
|
||||
fn heap_size_of_children(&self) -> usize {
|
||||
self.0.heap_size_of_children()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: HeapSizeOf> HeapSizeOf for Option<T> {
|
||||
fn heap_size_of_children(&self) -> usize {
|
||||
match *self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue