Reformat code
This commit is contained in:
1 parent
2fc58fcc2d
commit
29a90d48d9
8 files changed
+26
-33
No files matched your search
@@ -3,13 +3,13 @@ use crate::core::srs::{FADE_PER_DAY, MAX_SCORE, OrderMode, WordOpenMode};
|
||||
use crate::data::{INVALID_ID, Id};
|
||||
use chrono::{DateTime, NaiveDate, Utc};
|
||||
use fsrs::MemoryState;
|
||||
use litemap::LiteMap;
|
||||
use log::info;
|
||||
use rayon::prelude::*;
|
||||
use rhai::{Engine, Scope};
|
||||
use std::cmp::Ordering;
|
||||
use std::marker::PhantomData;
|
||||
use std::time::Instant;
|
||||
use litemap::LiteMap;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct WordData {
|
||||
|
||||
@@ -320,7 +320,8 @@ impl<T: EntityData + Clone, D: DbLayer<T>> Repository<T, D> for DataRepositoryIn
|
||||
}
|
||||
|
||||
fn create_now(&mut self, mut new: T) -> Result<EntityHandle<T>, NotificationData> {
|
||||
self.data_layer.add_entity(&mut new, &self.connection.read())?;
|
||||
self.data_layer
|
||||
.add_entity(&mut new, &self.connection.read())?;
|
||||
let index = self.cache.len();
|
||||
let handle = EntityHandle::new(new.id(), index, true);
|
||||
self.cache.push(new);
|
||||
@@ -378,7 +379,7 @@ impl<T: EntityData + Clone, D: DbLayer<T>> Repository<T, D> for DataRepositoryIn
|
||||
|
||||
fn start(&mut self) -> MaybeError {
|
||||
if self.version != 0 {
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
self.init()?;
|
||||
|
||||
Reference in new issue
Block a user