mirror of
https://github.com/rustmailer/bichon.git
synced 2026-08-03 07:48:34 +02:00
update
This commit is contained in:
@@ -48,6 +48,7 @@ async-imap = { git = "https://github.com/rustmailer/async-imap.git", branch = "m
|
||||
"runtime-tokio",
|
||||
"compress",
|
||||
] }
|
||||
tantivy = { version = "0.26.0", features = ["zstd-compression"] }
|
||||
webpki-roots.workspace = true
|
||||
rustls.workspace = true
|
||||
rustls-pki-types.workspace = true
|
||||
@@ -65,6 +66,5 @@ mail-send.workspace = true
|
||||
blake3.workspace = true
|
||||
uuid.workspace = true
|
||||
fjall.workspace = true
|
||||
tantivy.workspace = true
|
||||
tracing-log.workspace = true
|
||||
tokio-util.workspace = true
|
||||
|
||||
@@ -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