mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update ns[C]String::from -> ns[C]Str::from where possible
This commit is contained in:
parent
cc8b69bae1
commit
c1c98659b9
4 changed files with 10 additions and 12 deletions
|
@ -4086,13 +4086,13 @@ fn static_assert() {
|
|||
|
||||
pub fn set_list_style_type(&mut self, v: longhands::list_style_type::computed_value::T, device: &Device) {
|
||||
use gecko_bindings::bindings::Gecko_SetCounterStyleToString;
|
||||
use nsstring::{nsACString, nsCString};
|
||||
use nsstring::{nsACString, nsCStr};
|
||||
use self::longhands::list_style_type::computed_value::T;
|
||||
match v {
|
||||
T::CounterStyle(s) => s.to_gecko_value(&mut self.gecko.mCounterStyle, device),
|
||||
T::String(s) => unsafe {
|
||||
Gecko_SetCounterStyleToString(&mut self.gecko.mCounterStyle,
|
||||
&nsCString::from(s) as &nsACString)
|
||||
&nsCStr::from(&s) as &nsACString)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4679,9 +4679,8 @@ fn static_assert() {
|
|||
<%call expr="impl_coord_copy('word_spacing', 'mWordSpacing')"></%call>
|
||||
|
||||
fn clear_text_emphasis_style_if_string(&mut self) {
|
||||
use nsstring::nsString;
|
||||
if self.gecko.mTextEmphasisStyle == structs::NS_STYLE_TEXT_EMPHASIS_STYLE_STRING as u8 {
|
||||
self.gecko.mTextEmphasisStyleString.assign(&nsString::new());
|
||||
self.gecko.mTextEmphasisStyleString.truncate();
|
||||
self.gecko.mTextEmphasisStyle = structs::NS_STYLE_TEXT_EMPHASIS_STYLE_NONE as u8;
|
||||
}
|
||||
}
|
||||
|
@ -4797,10 +4796,9 @@ fn static_assert() {
|
|||
|
||||
fn clear_overflow_sides_if_string(&mut self) {
|
||||
use gecko_bindings::structs::nsStyleTextOverflowSide;
|
||||
use nsstring::nsString;
|
||||
fn clear_if_string(side: &mut nsStyleTextOverflowSide) {
|
||||
if side.mType == structs::NS_STYLE_TEXT_OVERFLOW_STRING as u8 {
|
||||
side.mString.assign(&nsString::new());
|
||||
side.mString.truncate();
|
||||
side.mType = structs::NS_STYLE_TEXT_OVERFLOW_CLIP as u8;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue