Share the platform-neutral Rust mobile contract (#91)
Dependency security audit / rustsec (push) Failing after 22s
Dependency security audit / rustsec (push) Failing after 22s
This commit is contained in:
1 parent
fcb36a0684
commit
180851087b
52 files changed
+8932
-4263
No files matched your search
@@ -61,14 +61,14 @@ fn harden_source(source: &str) -> Result<String, Box<dyn Error>> {
|
||||
}
|
||||
let source = source.replace(internal, "class InternalException(@Suppress(\"UNUSED_PARAMETER\") message: String) : kotlin.Exception(\"Native Rust failure ([REDACTED])\")")
|
||||
.replace(callback, "val err = \"Native callback failed ([REDACTED])\"");
|
||||
let records = Regex::new(r"(?ms)^data class (\w+) \((.*?)\n\)([^\{]*)\{\n")?;
|
||||
let records = Regex::new(r"(?ms)^([ \t]*)data class (\w+)\s*\((.*?)\)[^\{]*\{\n")?;
|
||||
if !records.is_match(&source) {
|
||||
return Err("UniFFI record template changed; review diagnostic hardening".into());
|
||||
}
|
||||
let source = records.replace_all(&source, |captures: ®ex::Captures<'_>| {
|
||||
format!(
|
||||
"{} override fun toString(): String = \"{}([REDACTED])\"\n",
|
||||
&captures[0], &captures[1]
|
||||
&captures[0], &captures[2]
|
||||
)
|
||||
});
|
||||
let errors = Regex::new(r#"(?m)(override val message\n\s*)get\(\) = ".*"$"#)?;
|
||||
|
||||
Reference in new issue
Block a user