Skip to content


Add an into_repr on the nsstring bindings.
Browse files Browse the repository at this point in the history
I didn't end up using this, but mystor reviewed it and it's useful.

MozReview-Commit-ID: 5LNzCEGpbLy
  • Loading branch information
bholley committed Apr 6, 2018
1 parent a0bdba7 commit 628aa6a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions support/gecko/nsstring/src/
Expand Up @@ -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 {
Expand Down

0 comments on commit 628aa6a

Please sign in to comment.