fix convert feature without source
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-08-10 14:20:11 +03:00
parent 9c4882fbbb
commit f874e59a11
4 changed files with 20 additions and 8 deletions

View File

@@ -30,8 +30,15 @@ source_async = [
"futures-util",
"async-stream",
]
convert = []
convert_async = ["futures", "futures-core", "futures-util", "async-stream"]
convert = ["zip"]
convert_async = [
"futures",
"futures-core",
"futures-util",
"async-stream",
"async_zip",
"tokio",
]
[dependencies]
serde = "1.0"

View File

@@ -3,6 +3,11 @@ pub mod async_db;
#[cfg(feature = "sync")]
pub mod db;
pub mod questions;
#[cfg(any(feature = "source", feature = "source_async"))]
#[cfg(any(
feature = "source",
feature = "source_async",
feature = "convert",
feature = "convert_async"
))]
pub mod source;
pub mod util;

View File

@@ -103,7 +103,7 @@ pub struct SourceQuestionsBatch {
pub questions: Vec<SourceQuestion>,
}
#[cfg(feature = "source")]
#[cfg(any(feature = "convert", feature = "source"))]
pub mod reader_sync {
use std::io::{Read, Seek};
use zip::ZipArchive;
@@ -211,10 +211,10 @@ pub mod reader_sync {
}
}
#[cfg(feature = "source")]
#[cfg(any(feature = "convert", feature = "source"))]
pub use reader_sync::{ReadSourceQuestionsBatches, SourceQuestionsZipReader};
#[cfg(feature = "source_async")]
#[cfg(any(feature = "convert_async", feature = "source_async"))]
pub mod reader_async {
use async_stream::stream;
use async_zip::tokio::read::seek::ZipFileReader;
@@ -326,5 +326,5 @@ pub mod reader_async {
}
}
}
#[cfg(feature = "source_async")]
#[cfg(any(feature = "convert_async", feature = "source_async"))]
pub use reader_async::{ReadSourceQuestionsBatchesAsync, SourceQuestionsZipReaderAsync};