remove debug and commented code

This commit is contained in:
Dietrich 2020-11-09 20:25:42 +01:00
parent 8fcd32eca2
commit ed06c58913
2 changed files with 1 additions and 20 deletions

View File

@ -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

View File

@ -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;