File tree 2 files changed +6
-15
lines changed
2 files changed +6
-15
lines changed Original file line number Diff line number Diff line change 10
10
//! This crate is able to deconstruct `v=spf1` and `spf2.0` records.
11
11
//!
12
12
//! # 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)
14
14
//! - Check and Create Spf Mechanism/Modifiers:
15
15
//! - [`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)
18
18
//!
19
19
//! # Feature Flags:
20
20
//! - `warn-dns` (Disabled by default.)
21
21
//! - This feature only applies to the Spf Parser and only warns of possible problems.
22
22
//! - `strict-dns` (Disabled by default.)
23
23
//! This enables syntactical checking of Domain Names.
24
24
//! - 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.
26
26
//!
27
27
mod helpers;
28
28
pub mod mechanism;
Original file line number Diff line number Diff line change @@ -54,12 +54,12 @@ impl std::fmt::Display for Spf {
54
54
/// use decon_spf::SpfError;
55
55
/// // Successful
56
56
/// let input = "v=spf1 a mx -all";
57
- /// let spf: Spf = input.to_string(). parse().unwrap();
57
+ /// let spf: Spf = input.parse().unwrap();
58
58
/// assert_eq!(spf.to_string(), input);
59
59
///
60
60
/// // Additional Space between `A` and `MX`
61
61
/// 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();
63
63
/// assert_eq!(err.to_string(), SpfError::WhiteSpaceSyntaxError.to_string());
64
64
/// // err.to_string() -> "Spf contains two or more consecutive whitespace characters.");
65
65
///
@@ -526,15 +526,6 @@ impl Spf {
526
526
}
527
527
spf
528
528
}
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
- }
538
529
/// Returns a reference to the string stored in `source`
539
530
pub fn source ( & self ) -> & String {
540
531
// Source is set to "" by default.
You can’t perform that action at this time.
0 commit comments