Skip to content
Merged

Lcc #23

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: Tagging and Publish
on:
push:
branches:
- main
- main

permissions: write-all

env:
env:
CARGO_TERM_COLOR: always
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

Expand Down Expand Up @@ -45,8 +45,8 @@ jobs:
git tag "$VERSION"
git push origin "$VERSION"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

valu3_derive_publish:
needs: tag
name: Valu3 Derive - latest
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ jobs:
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cargo build --verbose
- run: cargo test --verbose

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
*.parquet
*.parquet
.vscode
9 changes: 8 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,12 @@
"rust-analyzer.linkedProjects": [
"./valu3/Cargo.toml",
"./valu3/Cargo.toml"
]
],
"workbench.colorCustomizations": {
"[Material Theme Darker High Contrast]": {},
"[Material Theme Darker]": {},
"activityBar.background": "#131E83",
"titleBar.activeBackground": "#1A29B7",
"titleBar.activeForeground": "#FBFBFE"
}
}
68 changes: 34 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
Welcome to **Valu3** - the ultimate, flexible, and powerful library for manipulating diverse data types in your Rust projects. Say goodbye to the complexity of handling numbers, strings, arrays, objects, and datetime values. Valu3 is here to make your life easier!


[![crates.io](https://img.shields.io/crates/v/valu3?label=0.6.2)](https://crates.io/crates/valu3)
[![Documentation](https://docs.rs/valu3/badge.svg?version=0.6.2)](https://docs.rs/valu3/0.6.2)
[![crates.io](https://img.shields.io/crates/v/valu3?label=0.6.3)](https://crates.io/crates/valu3)
[![Documentation](https://docs.rs/valu3/badge.svg?version=0.6.3)](https://docs.rs/valu3/0.6.3)
![MSRV](https://img.shields.io/badge/rustc-1.59+-ab6000.svg)
![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-web.svg)
[![Dependency Status](https://deps.rs/crate/valu3/0.6.2/status.svg)](https://deps.rs/crate/valu3/0.6.2)
[![Dependency Status](https://deps.rs/crate/valu3/0.6.3/status.svg)](https://deps.rs/crate/valu3/0.6.3)
![Main test](https://github.com/cogup/valu3/actions/workflows/main-test.yml/badge.svg)
[![codecov](https://codecov.io/gh/cogup/valu3/branch/master/graph/badge.svg)](https://codecov.io/gh/cogup/valu3)
![downloads](https://img.shields.io/crates/d/valu3.svg)
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.2
0.6.3
12 changes: 12 additions & 0 deletions retag.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
#!/bin/bash

# This script replaces the old tag with the new tag in the files listed in the files array.
# Usage: ./retag.sh <new_tag>
# Example: ./retag.sh 0.1.0

# -h or --help: Show help message
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
echo "This script replaces the old tag with the new tag in the files listed in the files array."
echo "Usage: ./retag.sh <new_tag>"
echo "Example: ./retag.sh 0.1.0"
exit 0
fi

# Verifica se o arquivo VERSION.txt existe
if [ ! -f "VERSION.txt" ]; then
echo "Arquivo VERSION.txt não encontrado."
Expand Down
16 changes: 8 additions & 8 deletions valu3/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "valu3"
version = "0.6.2"
version = "0.6.3"
edition = "2021"
license = "MIT OR Apache-2.0"
readme = "crates-io.md"
Expand All @@ -12,17 +12,17 @@ categories = ["encoding", "no-std", "parsing"]
documentation = "https://docs.rs/valu3"

[dependencies]
pest="2.7.13"
pest_derive="2.7.13"
regex = "1.10.6"
chrono = "0.4.38"
serde = { version = "1.0.210", features = ["derive"], optional = true }
valu3-derive = { path = "../valu3_derive", optional = true, version = "0.6.2"}
pest="2.7.15"
pest_derive="2.7.15"
regex = "1.11.1"
chrono = "0.4.39"
serde = { version = "1.0.216", features = ["derive"], optional = true }
valu3-derive = { path = "../valu3_derive", optional = true, version = "0.6.3"}
bincode = { version = "1.3.3", optional = true }

[dev-dependencies]
rand = "0.8.5"
serde_json = "1.0.128"
serde_json = "1.0.134"

[features]
default = ["parser", "derive", "serde", "bin"]
Expand Down
6 changes: 3 additions & 3 deletions valu3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
Welcome to **Valu3** - the ultimate, flexible, and powerful library for manipulating diverse data types in your Rust projects. Say goodbye to the complexity of handling numbers, strings, arrays, objects, and datetime values. Valu3 is here to make your life easier!


[![crates.io](https://img.shields.io/crates/v/valu3?label=0.6.2)](https://crates.io/crates/valu3)
[![Documentation](https://docs.rs/valu3/badge.svg?version=0.6.2)](https://docs.rs/valu3/0.6.2)
[![crates.io](https://img.shields.io/crates/v/valu3?label=0.6.3)](https://crates.io/crates/valu3)
[![Documentation](https://docs.rs/valu3/badge.svg?version=0.6.3)](https://docs.rs/valu3/0.6.3)
![MSRV](https://img.shields.io/badge/rustc-1.59+-ab6000.svg)
![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-web.svg)
[![Dependency Status](https://deps.rs/crate/valu3/0.6.2/status.svg)](https://deps.rs/crate/valu3/0.6.2)
[![Dependency Status](https://deps.rs/crate/valu3/0.6.3/status.svg)](https://deps.rs/crate/valu3/0.6.3)
![Main test](https://github.com/cogup/valu3/actions/workflows/main-test.yml/badge.svg)
[![codecov](https://codecov.io/gh/cogup/valu3/branch/master/graph/badge.svg)](https://codecov.io/gh/cogup/valu3)
![downloads](https://img.shields.io/crates/d/valu3.svg)
Expand Down
7 changes: 4 additions & 3 deletions valu3/src/types/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl From<&str> for DateTime {
impl From<i64> for DateTime {
fn from(value: i64) -> Self {
DateTime::DateTime(ChDateTime::from_naive_utc_and_offset(
chrono::NaiveDateTime::from_timestamp_nanos(value).unwrap(),
chrono::DateTime::from_timestamp_nanos(value).naive_local(),
Utc,
))
}
Expand Down Expand Up @@ -214,12 +214,13 @@ impl DateTimeBehavior for DateTime {
fn timestamp(&self) -> Option<i64> {
match self {
DateTime::DateTime(datetime) => Some(datetime.timestamp()),
DateTime::Date(date) => Some(date.and_hms_opt(0, 0, 0).unwrap().timestamp()),
DateTime::Date(date) => Some(date.and_hms_opt(0, 0, 0).unwrap().and_utc().timestamp()),
DateTime::Time(time) => Some(
NaiveDate::from_ymd_opt(1970, 1, 1)
.unwrap()
.and_hms_opt(time.hour(), time.minute(), time.second())
.unwrap()
.and_utc()
.timestamp(),
),
}
Expand Down Expand Up @@ -370,7 +371,7 @@ mod tests {

assert_eq!(
dt_date.timestamp(),
Some(date.and_hms_opt(0, 0, 0).unwrap().timestamp())
Some(date.and_hms_opt(0, 0, 0).unwrap().and_utc().timestamp())
);
assert_eq!(dt_datetime.timestamp(), Some(datetime.unwrap().timestamp()));
}
Expand Down
4 changes: 3 additions & 1 deletion valu3/src/types/stringb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
//! This implementation offers a way to handle strings with additional features, such as converting
//! the string to uppercase or lowercase, trimming, replacing, and concatenating. It also handles
//! converting between different representations of strings, such as `CString`, `String`, and `Vec<u8>`.
#[cfg(feature = "cstring")]
use std::ffi::CString;
use std::fmt::{Display, Formatter};
use std::ops::Deref;

Expand Down Expand Up @@ -118,7 +120,7 @@ impl StringB {
pub fn as_string(&self) -> String {
self.value.to_str().unwrap().to_string()
}

#[cfg(not(feature = "cstring"))]
pub fn as_string(&self) -> String {
self.value.clone()
Expand Down
Loading
Loading