tests: import crate Result

This commit is contained in:
Stefan Bühler 2020-03-08 15:52:51 +01:00
parent ff13630b8c
commit abfd1e9b95
1 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,7 @@
mod powerdns_tests; mod powerdns_tests;
use crate::common_types::classes; use crate::common_types::classes;
use crate::errors::*;
use crate::records::structs; use crate::records::structs;
use crate::ser::packet::DnsPacketData; use crate::ser::packet::DnsPacketData;
use crate::ser::{packet, text, StaticRRData}; use crate::ser::{packet, text, StaticRRData};
@ -9,7 +10,7 @@ use failure::ResultExt;
use std::fmt; use std::fmt;
use std::io::Cursor; use std::io::Cursor;
fn rrdata_de<T>(data: &'static [u8]) -> crate::errors::Result<T> fn rrdata_de<T>(data: &'static [u8]) -> Result<T>
where where
T: StaticRRData, T: StaticRRData,
{ {
@ -19,7 +20,7 @@ where
Ok(result) Ok(result)
} }
fn rrdata_parse<T>(data: &str) -> crate::errors::Result<T> fn rrdata_parse<T>(data: &str) -> Result<T>
where where
T: StaticRRData, T: StaticRRData,
{ {
@ -30,7 +31,7 @@ where
text::parse_with(data, |data| T::dns_parse_rr_data(&ctx, data)) text::parse_with(data, |data| T::dns_parse_rr_data(&ctx, data))
} }
fn check<T>(txt: &str, data: &'static [u8]) -> crate::errors::Result<()> fn check<T>(txt: &str, data: &'static [u8]) -> Result<()>
where where
T: StaticRRData + fmt::Debug + PartialEq, T: StaticRRData + fmt::Debug + PartialEq,
{ {
@ -40,7 +41,7 @@ where
Ok(()) Ok(())
} }
fn check2<T>(txt: &str, data: &'static [u8], canon: &str) -> crate::errors::Result<()> fn check2<T>(txt: &str, data: &'static [u8], canon: &str) -> Result<()>
where where
T: StaticRRData + fmt::Debug + PartialEq, T: StaticRRData + fmt::Debug + PartialEq,
{ {