diff --git a/lib/wot/data/mod.rs b/lib/wot/data/mod.rs index e88b69337c1da0c2a0b9a9fa5d2e8652e74d1c52..d7851b23ca54293c9970c209bc3a0b8d4cce1fc7 100644 --- a/lib/wot/data/mod.rs +++ b/lib/wot/data/mod.rs @@ -87,8 +87,6 @@ impl<'de> Deserialize<'de> for NodeId { pub enum NewLinkResult { /// Certification worked. Ok(usize), - /// This certification already exist. - AlreadyCertified(usize), /// All available certifications has been used. AllCertificationsUsed(usize), /// Unknown source. diff --git a/lib/wot/data/rusty.rs b/lib/wot/data/rusty.rs index 22cdd86612fa5e8fd2e51d02f17195572e1844a7..330902254357d389a0aaf07a99824efd85efa03c 100644 --- a/lib/wot/data/rusty.rs +++ b/lib/wot/data/rusty.rs @@ -134,8 +134,6 @@ impl WebOfTrust for RustyWebOfTrust { NewLinkResult::UnknownTarget() } else if self.nodes[source.0].issued_count >= self.max_links { NewLinkResult::AllCertificationsUsed(self.nodes[target.0].links_source.len()) - } else if self.nodes[target.0].links_source.contains(&source) { - NewLinkResult::AlreadyCertified(self.nodes[target.0].links_source.len()) } else { self.nodes[source.0].issued_count += 1; self.nodes[target.0].links_source.insert(source); diff --git a/lib/wot/lib.rs b/lib/wot/lib.rs index de3734d8be3d881faedd273654d1bdca86b52737..669613ce785242857e88441d54459f737e314bff 100644 --- a/lib/wot/lib.rs +++ b/lib/wot/lib.rs @@ -196,14 +196,6 @@ mod tests { // should be able to add some links, cert count is returned assert_eq!(wot.add_link(NodeId(2), NodeId(0)), NewLinkResult::Ok(1)); assert_eq!(wot.add_link(NodeId(4), NodeId(0)), NewLinkResult::Ok(2)); - assert_eq!( - wot.add_link(NodeId(4), NodeId(0)), - NewLinkResult::AlreadyCertified(2) - ); - assert_eq!( - wot.add_link(NodeId(4), NodeId(0)), - NewLinkResult::AlreadyCertified(2) - ); assert_eq!(wot.add_link(NodeId(5), NodeId(0)), NewLinkResult::Ok(3)); // should exist new links