Skip to content

Commit 62f0df9

Browse files
committed
Coerce to f64 instead of potentially f64 -> f32 -> f64
1 parent 0e46268 commit 62f0df9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

codegen/structs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,11 +480,11 @@ impl StructBindGenerator {
480480
write_str!(self, "\n #[setter]");
481481
write_fmt!(
482482
self,
483-
" pub fn {variable_name}(&mut self, py: Python, value: f32) {{",
483+
" pub fn {variable_name}(&mut self, py: Python, value: f64) {{",
484484
);
485485
write_fmt!(
486486
self,
487-
" self.{variable_name} = crate::float_to_py(py, value);"
487+
" self.{variable_name} = PyFloat::new(py, value).unbind();"
488488
);
489489
write_str!(self, " }");
490490
}

0 commit comments

Comments
 (0)