Bug 1620998 - Break the dependency between the mozannotation_client crate and the nsstring crate, so that the latter can be used outside of libxul r=afranchuk

Differential Revision: https://phabricator.services.mozilla.com/D231800
This commit is contained in:
Gabriele Svelto
2025-02-04 11:24:17 +00:00
parent 5fae46ee43
commit 5349750f2a
4 changed files with 6 additions and 5 deletions

3
Cargo.lock generated
View File

@@ -4248,9 +4248,6 @@ dependencies = [
[[package]]
name = "mozannotation_client"
version = "0.1.0"
dependencies = [
"nsstring",
]
[[package]]
name = "mozannotation_server"

View File

@@ -8,4 +8,3 @@ license = "MPL-2.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
nsstring = { path = "../../../xpcom/rust/nsstring/" }

View File

@@ -13,3 +13,5 @@ includes = ["nsStringFwd.h"]
[export.rename]
"ThinVec" = "nsTArray"
[export]
exclude = ["nsCString"]

View File

@@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
use nsstring::nsCString;
use std::{
alloc::{self, Layout},
cmp::min,
@@ -306,6 +305,10 @@ fn store_annotation<T>(id: u32, contents: AnnotationContents, address: *const T)
old
}
// Dummy definition so that we don't have to import the nsstring crate.
#[allow(non_camel_case_types)]
pub struct nsCString {}
/// Register a pointer to an nsCString string.
///
/// Returns the value of the previously registered annotation or null.