Skip to content

Commit

Permalink
Merge pull request #10 from superwall/develop
Browse files Browse the repository at this point in the history
0.1.12
  • Loading branch information
yusuftor authored Oct 22, 2024
2 parents a070662 + 8be57d1 commit 03f68d8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
14 changes: 10 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
# CHANGELOG

## 0.1.12

### Fixes

- Adds Result types to fix issues when building for iOS.

## 0.1.11

## Enhancements
### Enhancements

- Adds new Android target
- Ensures JSON deserialization is done in a safe manner

## 0.1.10

## Enhancements
### Enhancements

- Updates github workflow for the renaming of the iOS repository.

## 0.1.9

## Enhancements
### Enhancements

- Added returning of a JSON encoded `Result<PassableValue,String>` from the exposed methods instead of relying on panics.
Example JSON:
- Error: `{"Err":"No such key: should_display"}`
- Ok: `{"Ok":{"type":"bool","value":true}}`

## Fixes
### Fixes

- Fixed a bug where getting properties from `device` would panic when `device` functions were defined
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cel-eval"
version = "0.1.11"
version = "0.1.12"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.htmlž
Expand Down
12 changes: 3 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub fn evaluate_ast_with_context(definition: String, host: Arc<dyn HostContext>)
let data = match data {
Ok(data) => data,
Err(_) => {
let e = Err("Invalid execution context JSON".to_string());
let e : Result<_, String> = Err::<ASTExecutionContext,String>("Invalid execution context JSON".to_string());
return serde_json::to_string(&e).unwrap()
}
};
Expand All @@ -87,7 +87,7 @@ pub fn evaluate_ast(ast: String) -> String {
let data : JSONExpression = match data {
Ok(data) => data,
Err(_) => {
let e = Err("Invalid definition for AST Execution".to_string());
let e : Result<_, String> = Err::<JSONExpression,String>("Invalid definition for AST Execution".to_string());
return serde_json::to_string(&e).unwrap()
}
};
Expand All @@ -110,13 +110,7 @@ pub fn evaluate_with_context(definition: String, host: Arc<dyn HostContext>) ->
let data: ExecutionContext = match data {
Ok(data) => data,
Err(_) => {
let e = Err("Invalid execution context JSON".to_string());
return serde_json::to_string(&e).unwrap()
}
};
let data = match data {
Ok(data) => data,
Err(e) => {
let e : Result<ExecutionContext, String> = Err("Invalid execution context JSON".to_string());
return serde_json::to_string(&e).unwrap()
}
};
Expand Down

0 comments on commit 03f68d8

Please sign in to comment.