mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 11:57:07 +02:00
Do not duplicate NDJson when unecessary
This commit is contained in:
parent
e974be9518
commit
d683f5980c
3 changed files with 98 additions and 58 deletions
|
@ -136,6 +136,14 @@ pub struct File {
|
|||
}
|
||||
|
||||
impl File {
|
||||
pub fn from_parts(path: PathBuf, file: Option<NamedTempFile>) -> Self {
|
||||
Self { path, file }
|
||||
}
|
||||
|
||||
pub fn into_parts(self) -> (PathBuf, Option<NamedTempFile>) {
|
||||
(self.path, self.file)
|
||||
}
|
||||
|
||||
pub fn dry_file() -> Result<Self> {
|
||||
Ok(Self { path: PathBuf::new(), file: None })
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue