More sensible defaults for Transfer struct
This commit is contained in:
parent
2579f2e965
commit
768b88a562
|
@ -4,7 +4,7 @@ use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
#[derive(PartialEq, Clone, Default, Debug, Serialize, Deserialize)]
|
#[derive(PartialEq, Clone, Debug, Serialize, Deserialize)]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
pub struct Transfer {
|
pub struct Transfer {
|
||||||
pub source_id: Uuid,
|
pub source_id: Uuid,
|
||||||
|
@ -16,6 +16,19 @@ pub struct Transfer {
|
||||||
pub volume: f32,
|
pub volume: f32,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for Transfer {
|
||||||
|
fn default() -> Self {
|
||||||
|
Transfer {
|
||||||
|
source_id: Default::default(),
|
||||||
|
dest_id: Default::default(),
|
||||||
|
name: "New Transfer".to_string(),
|
||||||
|
id: Default::default(),
|
||||||
|
transfer_region: Default::default(),
|
||||||
|
volume: 2.5f32,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn default_volume() -> f32 {
|
fn default_volume() -> f32 {
|
||||||
2.5f32
|
2.5f32
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue