Bladeren bron

cli: Improve converting non-conflicting paths to names in IDL (#2588)

acheron 2 jaren geleden
bovenliggende
commit
2af9cc669b
2 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 1 1
      cli/src/lib.rs
  2. 1 1
      tests/idl/idls/build.json

+ 1 - 1
cli/src/lib.rs

@@ -2458,7 +2458,7 @@ fn generate_idl_build(no_docs: bool) -> Result<Vec<Idl>> {
                 let replaced_idl = modified_idl.replace(path, &format!(r#""{name}""#));
 
                 // Check whether there is a conflict
-                let has_conflict = replaced_idl.contains(&format!("::{name}"));
+                let has_conflict = replaced_idl.contains(&format!(r#"::{name}""#));
                 if !has_conflict {
                     modified_idl = replaced_idl;
                 }

+ 1 - 1
tests/idl/idls/build.json

@@ -309,7 +309,7 @@
       }
     },
     {
-      "name": "idl::State",
+      "name": "State",
       "docs": [
         "An account containing various fields"
       ],