From ed06c58913d5db602a716fe813a3733cb63bd938 Mon Sep 17 00:00:00 2001 From: Dietrich Date: Mon, 9 Nov 2020 20:25:42 +0100 Subject: [PATCH] remove debug and commented code --- src/user/mod.rs | 18 ------------------ tests/delete_user_test.rs | 3 +-- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/user/mod.rs b/src/user/mod.rs index d2603fd..2370982 100644 --- a/src/user/mod.rs +++ b/src/user/mod.rs @@ -31,24 +31,6 @@ impl User { crate::Password::Shadow(ref s) => Some(s), } } - /*fn get_nth_line(content: &str, n: u32) -> (String, u64) { - use std::io::BufRead; - let mut cursor = std::io::Cursor::new(content); - - let mut offset: u64 = 0; - let mut tmp = String::new(); - for _ in 0..n + 1 { - tmp = String::new(); - offset += cursor.read_line(&mut tmp).expect("failed to read line") as u64; - //trace!("reading user{}: {}", i, &tmp); - } - (tmp.trim().to_owned(), offset) - } - pub(crate) fn is_unchanged_in(&self, content: &str) -> (u64, usize, bool) { - let (line, offset) = Self::get_nth_line(content, self.pos); - trace!("Olduser:\n\t{}\nNewuser\n\t{}", &self.source, &line); - (offset, line.len(), line == self.source) - }*/ #[must_use] pub fn remove_in(&self, content: &str) -> String { content diff --git a/tests/delete_user_test.rs b/tests/delete_user_test.rs index 462b0f0..afbbbb1 100644 --- a/tests/delete_user_test.rs +++ b/tests/delete_user_test.rs @@ -2,7 +2,7 @@ extern crate adduser; mod testfiles; #[test] -fn test_test() { +fn test_delete_user_function() { use testfiles::Fixture; use adduser::api::UserDBWrite; @@ -36,7 +36,6 @@ fn test_test() { let pflines2 = pf2.lines(); for (l1, l2) in pflines.zip(pflines2) { if l1 != l2 { - dbg!(l1, l2); assert!(l1.starts_with("teste")); assert!(l2.starts_with("bergfried")); break;