mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Add an into_repr on the nsstring bindings.
I didn't end up using this, but mystor reviewed it and it's useful. MozReview-Commit-ID: 5LNzCEGpbLy
This commit is contained in:
parent
a0bdba73e3
commit
628aa6a630
1 changed files with 6 additions and 0 deletions
|
@ -559,6 +559,12 @@ macro_rules! define_string_types {
|
|||
hdr: $StringRepr::new(ClassFlags::NULL_TERMINATED),
|
||||
}
|
||||
}
|
||||
|
||||
/// Converts this String into a StringRepr, which will leak if the
|
||||
/// repr is not passed to something that knows how to free it.
|
||||
pub fn into_repr(mut self) -> $StringRepr {
|
||||
mem::replace(&mut self.hdr, $StringRepr::new(ClassFlags::NULL_TERMINATED))
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for $String {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue