Skip to content

Commit 83e1811

Browse files
authored
fix truncated string value problem (#6)
1 parent eeda715 commit 83e1811

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hyperparameter"
3-
version = "0.1.0"
3+
version = "0.5.2"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -11,7 +11,6 @@ crate-type = ["cdylib"]
1111

1212
[dependencies]
1313
cxx = "1.0"
14-
arraystring = "0.3.0"
1514
pyo3 = { version = "0.18.1", features = [
1615
"extension-module",
1716
"abi3",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "maturin"
44

55
[project]
66
name = "hyperparameter"
7-
version = "0.5.1"
7+
version = "0.5.2"
88
authors = [{ name = "Reiase", email = "[email protected]" }]
99
description = "A hyper-parameter library for researchers, data scientists and machine learning engineers."
1010
requires-python = ">=3.7"

src/entry.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use arraystring::CacheString;
21
use std::{ffi::c_void, sync::Arc};
32

43
#[derive(Debug, Clone, PartialEq)]
@@ -15,7 +14,7 @@ pub enum Value {
1514
Empty,
1615
Int(i64),
1716
Float(f64),
18-
Text(CacheString),
17+
Text(String),
1918
Boolen(bool),
2019
UserDefined(
2120
*mut c_void, //data
@@ -38,19 +37,19 @@ impl From<f64> for Value {
3837

3938
impl From<String> for Value {
4039
fn from(value: String) -> Self {
41-
Value::Text(CacheString::from_str_truncate(value))
40+
Value::Text(value)
4241
}
4342
}
4443

4544
impl From<&String> for Value {
4645
fn from(value: &String) -> Self {
47-
Value::Text(CacheString::from_str_truncate(value))
46+
Value::Text(value.clone())
4847
}
4948
}
5049

5150
impl From<&str> for Value {
5251
fn from(value: &str) -> Self {
53-
Value::Text(CacheString::from_str_truncate(value))
52+
Value::Text(value.to_string())
5453
}
5554
}
5655

0 commit comments

Comments
 (0)