Skip to content

Commit

Permalink
leak re-pattern result; tag 0.8.51-a2
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed May 16, 2024
1 parent 9431bcb commit cee8b11
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- uses: calcit-lang/[email protected]
with:
version: "0.8.51-a1"
version: "0.8.51-a2"

- uses: dtolnay/rust-toolchain@stable
with:
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ crate-type = ["dylib"] # Creates dynamic lib
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
cirru_edn = "0.6.4-a1"
cirru_edn = "0.6.4-a2"
# cirru_edn = { path = "/Users/chenyong/repo/cirru/edn.rs" }
cirru_parser = "0.1.29"
regex = "1.10.4"
7 changes: 6 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ pub fn re_pattern(args: Vec<Edn>) -> Result<Edn, String> {
if args.len() == 1 {
match &args[0] {
Edn::Str(s) => match Regex::new(s) {
Ok(pattern) => Ok(Edn::AnyRef(EdnAnyRef(Arc::from(pattern)))),
Ok(pattern) => {
let p = Arc::from(pattern);
let p2 = p.to_owned();
// std::mem::forget(p);
Ok(Edn::AnyRef(EdnAnyRef(p2)))
}
Err(e) => Err(format!("re-pattern failed, {}", e)),
},
_ => Err(format!("re-pattern expect 1 string, got {:?}", args)),
Expand Down

0 comments on commit cee8b11

Please sign in to comment.