mirror of
https://github.com/rustmailer/bichon.git
synced 2026-08-03 07:48:34 +02:00
update
This commit is contained in:
@@ -16,7 +16,12 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use tantivy::IndexWriter;
|
||||
use tantivy::{schema::Facet, IndexWriter};
|
||||
|
||||
use crate::{
|
||||
error::{code::ErrorCode, BichonResult},
|
||||
raise_error,
|
||||
};
|
||||
|
||||
pub mod attachment;
|
||||
pub mod envelope;
|
||||
@@ -66,3 +71,9 @@ pub fn fatal_commit(writer: &mut IndexWriter) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn validate_facet(tag: &str) -> BichonResult<()> {
|
||||
Facet::from_text(tag)
|
||||
.map(|_| ())
|
||||
.map_err(|e| raise_error!(format!("{:#?}", e), ErrorCode::InvalidParameter))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user