commit - 42c207aa93594ebc908a3c7f38aac5911b4e595e
commit + 00ba4d7d8dbcd8686722b922f2f749431f8575dd
blob - fafd495303fcdc34860ba9a3799c2ff4e6560af5
blob + d56f0bb587161ce5d3c502e8725f2036ffc8c7aa
--- eur-lex-scraper-naive/src/models/articles.rs
+++ eur-lex-scraper-naive/src/models/articles.rs
-use crate::models::enacting_terms::{IntoItem, Item};
+use crate::models::enacting_terms::Item;
#[derive(Debug, Default, PartialEq, Eq)]
pub struct Article {
pub text: String,
}
-impl IntoItem for Article {
+impl Into<Item> for Article {
fn into(self) -> super::enacting_terms::Item {
Item::Article(self)
}
blob - 2c542a296f1ac02fbe95809350d0415a5359c777
blob + 0e4d0727da318cfba1bf97599d6c313d32ee3971
--- eur-lex-scraper-naive/src/models/enacting_terms.rs
+++ eur-lex-scraper-naive/src/models/enacting_terms.rs
use crate::models::articles::Article;
-pub trait IntoItem {
- fn into(self) -> Item;
-}
-
#[derive(Debug, PartialEq, Eq)]
pub enum Item {
Article(Article),
}
impl EnactingTerms {
- pub fn push(&mut self, item: impl IntoItem) {
+ pub fn push(&mut self, item: impl Into<Item>) {
self.items.push(item.into());
}
}
}
impl Chapter {
- pub fn push(&mut self, item: impl IntoItem) {
+ pub fn push(&mut self, item: impl Into<Item>) {
self.items.push(item.into());
}
}
-impl IntoItem for Chapter {
+impl Into<Item> for Chapter {
fn into(self) -> Item {
Item::Chapter(self)
}
}
}
-impl IntoItem for Section {
+impl Into<Item> for Section {
fn into(self) -> Item {
Item::Section(self)
}