Skip to content

Commit 2e10a61

Browse files
committed
Clean up documentation sample code and remove 0.2.0 deprecated code
1 parent fb083c5 commit 2e10a61

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010
//! This crate is able to deconstruct `v=spf1` and `spf2.0` records.
1111
//!
1212
//! # Abilities:
13-
//! - Check and Set Spf record version: [`Spf Versions`](spf::Spf::set_v1)
13+
//! - Check and Set Spf record version. See: [`Spf Versions`](spf::Spf::set_v1)
1414
//! - Check and Create Spf Mechanism/Modifiers:
1515
//! - [`Mechanism`](mechanism::Mechanism)
16-
//! - [`Check Qualifier Type`](mechanism::Mechanism::is_pass)
17-
//! - [`Check Mechanism Type`](mechanism::Mechanism::kind)
16+
//! - [`Mechanism Qualifier`](mechanism::Mechanism::is_pass)
17+
//! - [`Mechanism Kind`](mechanism::Mechanism::kind)
1818
//!
1919
//! # Feature Flags:
2020
//! - `warn-dns` (Disabled by default.)
2121
//! - This feature only applies to the Spf Parser and only warns of possible problems.
2222
//! - `strict-dns` (Disabled by default.)
2323
//! This enables syntactical checking of Domain Names.
2424
//! - When enabled it changes the behavour of `FromStr` for `Mechanism<String>` and
25-
//! `ParsedMechanism`
25+
//! `ParsedMechanism`. By default `Mechanism<String>`'s `rrdata` is not checked.
2626
//!
2727
mod helpers;
2828
pub mod mechanism;

src/spf/mod.rs

+2-11
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ impl std::fmt::Display for Spf {
5454
/// use decon_spf::SpfError;
5555
/// // Successful
5656
/// let input = "v=spf1 a mx -all";
57-
/// let spf: Spf = input.to_string().parse().unwrap();
57+
/// let spf: Spf = input.parse().unwrap();
5858
/// assert_eq!(spf.to_string(), input);
5959
///
6060
/// // Additional Space between `A` and `MX`
6161
/// let bad_input = "v=spf1 a mx -all";
62-
/// let err: SpfError = bad_input.to_string().parse::<Spf>().unwrap_err();
62+
/// let err: SpfError = bad_input.parse::<Spf>().unwrap_err();
6363
/// assert_eq!(err.to_string(), SpfError::WhiteSpaceSyntaxError.to_string());
6464
/// // err.to_string() -> "Spf contains two or more consecutive whitespace characters.");
6565
///
@@ -526,15 +526,6 @@ impl Spf {
526526
}
527527
spf
528528
}
529-
/// Returns a new string representation of the spf record if possible.
530-
/// This does not use the `source` attribute.
531-
#[deprecated(
532-
since = "0.2.0",
533-
note = "This has been deprecated. Use to_string() instead."
534-
)]
535-
pub fn as_spf(&self) -> Result<String, SpfError> {
536-
unimplemented!("Spf struct now has a Display trait. Start using to_string()")
537-
}
538529
/// Returns a reference to the string stored in `source`
539530
pub fn source(&self) -> &String {
540531
// Source is set to "" by default.

0 commit comments

Comments
 (0)