Showing
1 changed file
with
6 additions
and
6 deletions
@@ -75,21 +75,21 @@ impl<'a> From<&'a MarkdownJson> for MarkdownChange<'a> { | @@ -75,21 +75,21 @@ impl<'a> From<&'a MarkdownJson> for MarkdownChange<'a> { | ||
75 | } | 75 | } |
76 | } | 76 | } |
77 | 77 | ||
78 | -pub(crate) enum Action { | 78 | +pub(crate) enum _Action { |
79 | Created(Markdown), | 79 | Created(Markdown), |
80 | Found(Markdown), | 80 | Found(Markdown), |
81 | } | 81 | } |
82 | 82 | ||
83 | 83 | ||
84 | -pub(crate) fn create_markdown( pool: Arc<Pool> | ||
85 | - , item: MarkdownJson ) -> Result<Action, Error> { | 84 | +pub(crate) fn _create_markdown( pool: Arc<Pool> |
85 | + , item: MarkdownJson ) -> Result<_Action, Error> { | ||
86 | use crate::schema::markdowns::dsl::*; | 86 | use crate::schema::markdowns::dsl::*; |
87 | let db_connection = pool.get()?; | 87 | let db_connection = pool.get()?; |
88 | 88 | ||
89 | match markdowns . filter(name.eq(&item.name)) | 89 | match markdowns . filter(name.eq(&item.name)) |
90 | . first::<Markdown>(&db_connection) | 90 | . first::<Markdown>(&db_connection) |
91 | { | 91 | { |
92 | - Ok(result) => Ok(Action::Found(result)), | 92 | + Ok(result) => Ok(_Action::Found(result)), |
93 | Err(_) => { | 93 | Err(_) => { |
94 | let now = chrono::Local::now().naive_local(); | 94 | let now = chrono::Local::now().naive_local(); |
95 | let new_markdown = MarkdownNew { | 95 | let new_markdown = MarkdownNew { |
@@ -100,7 +100,7 @@ pub(crate) fn create_markdown( pool: Arc<Pool> | @@ -100,7 +100,7 @@ pub(crate) fn create_markdown( pool: Arc<Pool> | ||
100 | date_updated: &format!("{}", now), | 100 | date_updated: &format!("{}", now), |
101 | }; | 101 | }; |
102 | 102 | ||
103 | - Ok(Action::Created(db_connection.transaction(|| { | 103 | + Ok(_Action::Created(db_connection.transaction(|| { |
104 | insert_into(markdowns) . values(&new_markdown) | 104 | insert_into(markdowns) . values(&new_markdown) |
105 | . execute(&db_connection)?; | 105 | . execute(&db_connection)?; |
106 | 106 | ||
@@ -150,7 +150,7 @@ pub(crate) fn get_markdown( pool: Arc<Pool> | @@ -150,7 +150,7 @@ pub(crate) fn get_markdown( pool: Arc<Pool> | ||
150 | Ok(markdown) | 150 | Ok(markdown) |
151 | } | 151 | } |
152 | 152 | ||
153 | -pub(crate) fn delete_markdown( pool: Arc<Pool> | 153 | +pub(crate) fn _delete_markdown( pool: Arc<Pool> |
154 | , ident: i32 ) -> Result<usize, Error> | 154 | , ident: i32 ) -> Result<usize, Error> |
155 | { | 155 | { |
156 | use crate::schema::markdowns::dsl::*; | 156 | use crate::schema::markdowns::dsl::*; |
Please
register
or
login
to post a comment