diff --git a/include/grpc/support/slice.h b/include/grpc/support/slice.h index 37ba591047275419c9a0da06fb76888cee80a9bd..507cb19f64ba97ec49181bb24c426e9b2f0c4c27 100644 --- a/include/grpc/support/slice.h +++ b/include/grpc/support/slice.h @@ -175,10 +175,6 @@ gpr_slice gpr_empty_slice(void); int gpr_slice_cmp(gpr_slice a, gpr_slice b); int gpr_slice_str_cmp(gpr_slice a, const char *b); -/* Returns a c-string representation of a slice. Useful for logging or debugging - purposes only. The string representation can change in future */ -char *gpr_slice_to_cstring(gpr_slice slice); - #ifdef __cplusplus } #endif diff --git a/src/core/support/slice.c b/src/core/support/slice.c index 5b091f17b0f390b64f06202147dddd11c08a77fb..9f0ded4932b4d1f5123ee1ba4c989af3a2aa6fe8 100644 --- a/src/core/support/slice.c +++ b/src/core/support/slice.c @@ -341,10 +341,3 @@ int gpr_slice_str_cmp(gpr_slice a, const char *b) { if (d != 0) return d; return memcmp(GPR_SLICE_START_PTR(a), b, b_length); } - -char *gpr_slice_to_cstring(gpr_slice slice) { - char *result = gpr_malloc(GPR_SLICE_LENGTH(slice) + 1); - memcpy(result, GPR_SLICE_START_PTR(slice), GPR_SLICE_LENGTH(slice)); - result[GPR_SLICE_LENGTH(slice)] = '\0'; - return result; -} diff --git a/test/core/support/slice_test.c b/test/core/support/slice_test.c index 96070d5bc81217f588f5f5d04febb7013f3949c1..9e0e22c24b8896c44567052698f1e9a0727a766b 100644 --- a/test/core/support/slice_test.c +++ b/test/core/support/slice_test.c @@ -221,7 +221,6 @@ static void test_slice_from_copied_string_works(void) { LOG_TEST_NAME("test_slice_from_copied_string_works"); slice = gpr_slice_from_copied_string(text); - gpr_log(GPR_INFO, "slice: %s", gpr_slice_to_cstring(slice)); GPR_ASSERT(strlen(text) == GPR_SLICE_LENGTH(slice)); GPR_ASSERT(0 == memcmp(text, GPR_SLICE_START_PTR(slice), GPR_SLICE_LENGTH(slice)));