Skip to content

Commit

Permalink
rnet-gen: Fix manual implementation of split_once
Browse files Browse the repository at this point in the history
Signed-off-by: Matheus Castello <[email protected]>
  • Loading branch information
microhobby committed Nov 15, 2023
1 parent 9315dc9 commit 39366e4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rnet-gen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ fn generate_csharp_code(_opt: &Opt, name: &str, desc: LibDesc) -> anyhow::Result
let common = COMMON
.replace("__ClassName__", &name.to_camel_case())
.replace("\"__LibName__\"", &format!("{:?}", name));
let mut parts = common.splitn(2, "// __Remainder__");
let prefix = parts.next().unwrap();
let suffix = parts.next().unwrap();

let (prefix, suffix) = common.split_once("// __Remainder__").unwrap();

let mut extra_items = Vec::new();
let mut used_tuple_keys = HashMap::new();
Expand Down

0 comments on commit 39366e4

Please sign in to comment.