From 97ad8097e0cb274aa347c8ec6612bb942ab05f82 Mon Sep 17 00:00:00 2001 From: Walker Crouse Date: Mon, 28 Sep 2020 12:38:26 -0400 Subject: [PATCH] remove as_ptr() Signed-off-by: Walker Crouse --- zeroconf/src/macos/service.rs | 2 +- zeroconf/src/macos/txt_record.rs | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/zeroconf/src/macos/service.rs b/zeroconf/src/macos/service.rs index 1bd150a..e36f08b 100644 --- a/zeroconf/src/macos/service.rs +++ b/zeroconf/src/macos/service.rs @@ -100,7 +100,7 @@ impl BonjourMdnsService { let txt_record = self .txt_record .as_ref() - .map(|t| t.as_ptr()) + .map(|t| t.0.get_bytes_ptr()) .unwrap_or_null(); self.service.lock().unwrap().register_service( diff --git a/zeroconf/src/macos/txt_record.rs b/zeroconf/src/macos/txt_record.rs index f3d3b01..05f9331 100644 --- a/zeroconf/src/macos/txt_record.rs +++ b/zeroconf/src/macos/txt_record.rs @@ -8,7 +8,7 @@ use std::{mem, ptr}; /// Interface for interfacting with Bonjour's TXT record capabilities. #[derive(Debug)] -pub struct BonjourTxtRecord(ManagedTXTRecordRef); +pub struct BonjourTxtRecord(pub(crate) ManagedTXTRecordRef); impl BonjourTxtRecord { /// Constructs a new TXT recoord @@ -87,11 +87,6 @@ impl BonjourTxtRecord { Box::new(Values(Iter::new(self))) } - /// Returns a raw pointer to the underlying TXT data. - pub fn as_ptr(&self) -> *const c_void { - self.0.get_bytes_ptr() - } - /// Returns the size of the raw bytes in the TXT record. pub fn size(&self) -> u16 { self.0.get_length()