Replace the lasts space indents with tabs
This commit is contained in:
parent
e83af3d3e5
commit
0fe864e6db
3 changed files with 28 additions and 28 deletions
|
@ -1,5 +1,5 @@
|
|||
[workspace]
|
||||
members = [
|
||||
"opensmtpd",
|
||||
"opensmtpd-derive"
|
||||
"opensmtpd",
|
||||
"opensmtpd-derive"
|
||||
]
|
||||
|
|
|
@ -56,19 +56,19 @@
|
|||
//! use opensmtpd_derive::register;
|
||||
//!
|
||||
//! struct MyCounter {
|
||||
//! nb: u64,
|
||||
//! nb: u64,
|
||||
//! }
|
||||
//!
|
||||
//! impl Filter for MyCounter {
|
||||
//! #[register]
|
||||
//! fn on_report_link_disconnect(&mut self, _entry: &ReportEntry) {
|
||||
//! self.nb + 1;
|
||||
//! }
|
||||
//! #[register]
|
||||
//! fn on_report_link_disconnect(&mut self, _entry: &ReportEntry) {
|
||||
//! self.nb + 1;
|
||||
//! }
|
||||
//! }
|
||||
//!
|
||||
//! fn main() {
|
||||
//! let mut my_counter = MyCounter { nb: 0, };
|
||||
//! run_filter(&mut my_counter);
|
||||
//! let mut my_counter = MyCounter { nb: 0, };
|
||||
//! run_filter(&mut my_counter);
|
||||
//! }
|
||||
//! ```
|
||||
//!
|
||||
|
@ -88,23 +88,23 @@
|
|||
//! struct RmXOriginatingIp {}
|
||||
//!
|
||||
//! impl Filter for RmXOriginatingIp {
|
||||
//! #[register]
|
||||
//! fn on_filter_data_line(&mut self, entry: &FilterEntry, data_line: &[u8]) {
|
||||
//! if data_line.len() >= HEADER_LEN {
|
||||
//! let head_start = data_line[..HEADER_LEN].to_vec();
|
||||
//! if let Ok(s) = String::from_utf8(head_start) {
|
||||
//! if s.to_lowercase() == HEADER_NAME {
|
||||
//! return;
|
||||
//! }
|
||||
//! }
|
||||
//! }
|
||||
//! return_data_line(entry, data_line);
|
||||
//! }
|
||||
//! #[register]
|
||||
//! fn on_filter_data_line(&mut self, entry: &FilterEntry, data_line: &[u8]) {
|
||||
//! if data_line.len() >= HEADER_LEN {
|
||||
//! let head_start = data_line[..HEADER_LEN].to_vec();
|
||||
//! if let Ok(s) = String::from_utf8(head_start) {
|
||||
//! if s.to_lowercase() == HEADER_NAME {
|
||||
//! return;
|
||||
//! }
|
||||
//! }
|
||||
//! }
|
||||
//! return_data_line(entry, data_line);
|
||||
//! }
|
||||
//! }
|
||||
//!
|
||||
//! fn main() {
|
||||
//! let mut my_filter = RmXOriginatingIp {};
|
||||
//! run_filter(&mut my_filter);
|
||||
//! let mut my_filter = RmXOriginatingIp {};
|
||||
//! run_filter(&mut my_filter);
|
||||
//! }
|
||||
//! ```
|
||||
//!
|
||||
|
|
|
@ -109,11 +109,11 @@ mod tests {
|
|||
#[test]
|
||||
fn test_invalid_handshakes() {
|
||||
let test_vectors = vec![
|
||||
"config|smtpd-version|6.6.1\nconfig|smtp-session-timeout|\nconfig|subsystem|smtp-in\nconfig|ready\n",
|
||||
"config|smtp-session-timeout|300\nconfig|smtpd-version|6.6.1\nconfig|subsystem|smtp-in\nconfig|ready\n",
|
||||
"config|smtpd-version|6.6.1\nconfig|smtp-session-timeout|300\nconfig|subsystem|smtp-in\nconfig|ready",
|
||||
"config|smtpd-version|6.6.1\nconfig|smtp-session-timeout|300\nconfig|subsystem|smtp-in\nconfig|ready\r",
|
||||
];
|
||||
"config|smtpd-version|6.6.1\nconfig|smtp-session-timeout|\nconfig|subsystem|smtp-in\nconfig|ready\n",
|
||||
"config|smtp-session-timeout|300\nconfig|smtpd-version|6.6.1\nconfig|subsystem|smtp-in\nconfig|ready\n",
|
||||
"config|smtpd-version|6.6.1\nconfig|smtp-session-timeout|300\nconfig|subsystem|smtp-in\nconfig|ready",
|
||||
"config|smtpd-version|6.6.1\nconfig|smtp-session-timeout|300\nconfig|subsystem|smtp-in\nconfig|ready\r",
|
||||
];
|
||||
for input in test_vectors {
|
||||
let r = parse_handshake(input.as_bytes());
|
||||
assert!(r.is_err());
|
||||
|
|
Reference in a new issue