Skip to content

Commit aa8c44b

Browse files
committed
Update comments, update error messages
1 parent ced06a0 commit aa8c44b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

splashsurf/src/io/json_format.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ pub fn particles_from_json<R: Real, P: AsRef<Path>>(
1414
let file = File::open(path).context("Cannot open file for JSON parsing")?;
1515
let reader = BufReader::new(file);
1616

17-
// Read the JSON contents of the file as an instance of `User`.
18-
let json =
19-
serde_json::from_reader(reader).context("Reading of file to JSON structure failed")?;
17+
// Read the JSON contents of the file as an instance of `ParticleVecF32`.
18+
let json = serde_json::from_reader(reader)
19+
.context("Reading of file to JSON structure failed. Not a valid JSON file.")?;
2020
let particles = serde_json::from_value::<ParticleVecF32>(json)
21-
.context("Parsing of JSON structure as particle positions failed")?;
21+
.context("Parsing of JSON structure as particle positions failed. Expected JSON file containing particle positions like e.g. '[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]'.")?;
2222

2323
let particles = particles
2424
.into_iter()

splashsurf/src/reconstruction.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ pub(crate) fn reconstruction_pipeline_generic<I: Index, R: Real>(
584584
profile!("compute normals");
585585
let normals = mesh.par_vertex_normals();
586586
// Transmute Unit<Vector3<R>> to Vector3<R>
587+
// As shown in: https://doc.rust-lang.org/std/mem/fn.transmute.html#alternatives
587588
let normals = unsafe {
588589
let mut normals = std::mem::ManuallyDrop::new(normals);
589590
Vec::from_raw_parts(

0 commit comments

Comments
 (0)