Skip to content

Commit

Permalink
chore(ffi): Fix for failing musl build #399
Browse files Browse the repository at this point in the history
  • Loading branch information
rholshausen committed Mar 19, 2024
1 parent 85dc3e9 commit 0907745
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 4 additions & 2 deletions rust/pact_ffi/src/mock_server/bodies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ pub fn matchers_from_integration_json(m: &Map<String, Value>) -> anyhow::Result<
Some(t) => {
let val = json_to_string(t);
let rule = MatchingRule::create(val.as_str(), &v)
.inspect_err(|err| {
.map_err(|err| {
error!("Failed to create matching rule from JSON '{:?}': {}", m, err);
err
})?;
rules.push(rule);
}
Expand All @@ -212,8 +213,9 @@ pub fn matchers_from_integration_json(m: &Map<String, Value>) -> anyhow::Result<
let val = json_to_string(value);
MatchingRule::create(val.as_str(), &Value::Object(m.clone()))
.map(|r| vec![r])
.inspect_err(|err| {
.map_err(|err| {
error!("Failed to create matching rule from JSON '{:?}': {}", m, err);
err
})
}
},
Expand Down
5 changes: 1 addition & 4 deletions rust/pact_ffi/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use bytes::Bytes;
use expectest::prelude::*;
use itertools::Itertools;
use libc::c_char;
use log::LevelFilter;
use maplit::*;
use pact_models::bodies::OptionalBody;
use pact_models::PactSpecification;
Expand All @@ -27,8 +26,7 @@ use pact_ffi::mock_server::{
pactffi_create_mock_server,
pactffi_create_mock_server_for_pact,
pactffi_mock_server_mismatches,
pactffi_write_pact_file,
pactffi_mock_server_logs
pactffi_write_pact_file
};
#[allow(deprecated)]
use pact_ffi::mock_server::handles::{
Expand Down Expand Up @@ -76,7 +74,6 @@ use pact_ffi::verifier::{
pactffi_verifier_set_provider_info,
pactffi_verifier_shutdown
};
use pact_ffi::log::pactffi_log_to_buffer;

#[test]
fn post_to_mock_server_with_mismatches() {
Expand Down

0 comments on commit 0907745

Please sign in to comment.