Skip to content

Commit 9b56722

Browse files
committed
Remove double type coercion
1 parent f87734e commit 9b56722

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repository = "https://github.com/davidcole1340/ext-php-rs"
55
homepage = "https://github.com/davidcole1340/ext-php-rs"
66
license = "MIT OR Apache-2.0"
77
keywords = ["php", "ffi", "zend"]
8-
version = "0.11.2"
8+
version = "0.12.0"
99
authors = ["David Cole <[email protected]>"]
1010
edition = "2018"
1111
categories = ["api-bindings"]

src/types/zval.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl Zval {
9595
if self.is_double() {
9696
Some(unsafe { self.value.dval })
9797
} else {
98-
self.long().map(|x| x as f64)
98+
None
9999
}
100100
}
101101

@@ -114,17 +114,10 @@ impl Zval {
114114

115115
/// Returns the value of the zval if it is a string.
116116
///
117-
/// If the zval does not contain a string, the function will check if it
118-
/// contains a double or a long, and if so it will convert the value to
119-
/// a [`String`] and return it. Don't rely on this logic, as there is
120-
/// potential for this to change to match the output of the [`str()`]
121-
/// function.
122-
///
123117
/// [`str()`]: #method.str
124118
pub fn string(&self) -> Option<String> {
125119
self.str()
126120
.map(|s| s.to_string())
127-
.or_else(|| self.double().map(|x| x.to_string()))
128121
}
129122

130123
/// Returns the value of the zval if it is a string.

0 commit comments

Comments
 (0)