Replace the lasts space indents with tabs

This commit is contained in:
Rodolphe Bréard 2021-02-28 14:10:12 +01:00
parent e83af3d3e5
commit 0fe864e6db
3 changed files with 28 additions and 28 deletions

View file

@ -1,5 +1,5 @@
[workspace] [workspace]
members = [ members = [
"opensmtpd", "opensmtpd",
"opensmtpd-derive" "opensmtpd-derive"
] ]

View file

@ -56,19 +56,19 @@
//! use opensmtpd_derive::register; //! use opensmtpd_derive::register;
//! //!
//! struct MyCounter { //! struct MyCounter {
//! nb: u64, //! nb: u64,
//! } //! }
//! //!
//! impl Filter for MyCounter { //! impl Filter for MyCounter {
//! #[register] //! #[register]
//! fn on_report_link_disconnect(&mut self, _entry: &ReportEntry) { //! fn on_report_link_disconnect(&mut self, _entry: &ReportEntry) {
//! self.nb + 1; //! self.nb + 1;
//! } //! }
//! } //! }
//! //!
//! fn main() { //! fn main() {
//! let mut my_counter = MyCounter { nb: 0, }; //! let mut my_counter = MyCounter { nb: 0, };
//! run_filter(&mut my_counter); //! run_filter(&mut my_counter);
//! } //! }
//! ``` //! ```
//! //!
@ -88,23 +88,23 @@
//! struct RmXOriginatingIp {} //! struct RmXOriginatingIp {}
//! //!
//! impl Filter for RmXOriginatingIp { //! impl Filter for RmXOriginatingIp {
//! #[register] //! #[register]
//! fn on_filter_data_line(&mut self, entry: &FilterEntry, data_line: &[u8]) { //! fn on_filter_data_line(&mut self, entry: &FilterEntry, data_line: &[u8]) {
//! if data_line.len() >= HEADER_LEN { //! if data_line.len() >= HEADER_LEN {
//! let head_start = data_line[..HEADER_LEN].to_vec(); //! let head_start = data_line[..HEADER_LEN].to_vec();
//! if let Ok(s) = String::from_utf8(head_start) { //! if let Ok(s) = String::from_utf8(head_start) {
//! if s.to_lowercase() == HEADER_NAME { //! if s.to_lowercase() == HEADER_NAME {
//! return; //! return;
//! } //! }
//! } //! }
//! } //! }
//! return_data_line(entry, data_line); //! return_data_line(entry, data_line);
//! } //! }
//! } //! }
//! //!
//! fn main() { //! fn main() {
//! let mut my_filter = RmXOriginatingIp {}; //! let mut my_filter = RmXOriginatingIp {};
//! run_filter(&mut my_filter); //! run_filter(&mut my_filter);
//! } //! }
//! ``` //! ```
//! //!

View file

@ -109,11 +109,11 @@ mod tests {
#[test] #[test]
fn test_invalid_handshakes() { fn test_invalid_handshakes() {
let test_vectors = vec![ let test_vectors = vec![
"config|smtpd-version|6.6.1\nconfig|smtp-session-timeout|\nconfig|subsystem|smtp-in\nconfig|ready\n", "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|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",
"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|300\nconfig|subsystem|smtp-in\nconfig|ready\r",
]; ];
for input in test_vectors { for input in test_vectors {
let r = parse_handshake(input.as_bytes()); let r = parse_handshake(input.as_bytes());
assert!(r.is_err()); assert!(r.is_err());