mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Avoid clone in src/snapshot_middleware/json_model.rs
Co-authored-by: krakow10 <krakow20@gmail.com>
This commit is contained in:
parent
9a485d88ce
commit
d13d229eef
1 changed files with 3 additions and 2 deletions
|
|
@ -39,8 +39,9 @@ pub fn snapshot_json_model(
|
||||||
let specified_name = instance.name.clone();
|
let specified_name = instance.name.clone();
|
||||||
|
|
||||||
// Use the name from JSON if present, otherwise fall back to filename-derived name
|
// Use the name from JSON if present, otherwise fall back to filename-derived name
|
||||||
let instance_name = specified_name.clone().unwrap_or_else(|| name.to_owned());
|
if instance.name.is_none() {
|
||||||
instance.name = Some(instance_name);
|
instance.name = Some(name.to_owned());
|
||||||
|
}
|
||||||
|
|
||||||
let id = instance.id.take().map(RojoRef::new);
|
let id = instance.id.take().map(RojoRef::new);
|
||||||
let schema = instance.schema.take();
|
let schema = instance.schema.take();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue