remove debug and commented code
This commit is contained in:
parent
8fcd32eca2
commit
ed06c58913
@ -31,24 +31,6 @@ impl User {
|
|||||||
crate::Password::Shadow(ref s) => Some(s),
|
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]
|
#[must_use]
|
||||||
pub fn remove_in(&self, content: &str) -> String {
|
pub fn remove_in(&self, content: &str) -> String {
|
||||||
content
|
content
|
||||||
|
@ -2,7 +2,7 @@ extern crate adduser;
|
|||||||
mod testfiles;
|
mod testfiles;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_test() {
|
fn test_delete_user_function() {
|
||||||
use testfiles::Fixture;
|
use testfiles::Fixture;
|
||||||
|
|
||||||
use adduser::api::UserDBWrite;
|
use adduser::api::UserDBWrite;
|
||||||
@ -36,7 +36,6 @@ fn test_test() {
|
|||||||
let pflines2 = pf2.lines();
|
let pflines2 = pf2.lines();
|
||||||
for (l1, l2) in pflines.zip(pflines2) {
|
for (l1, l2) in pflines.zip(pflines2) {
|
||||||
if l1 != l2 {
|
if l1 != l2 {
|
||||||
dbg!(l1, l2);
|
|
||||||
assert!(l1.starts_with("teste"));
|
assert!(l1.starts_with("teste"));
|
||||||
assert!(l2.starts_with("bergfried"));
|
assert!(l2.starts_with("bergfried"));
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user