Skip to content

Commit f0cadf8

Browse files
authored
Merge pull request #20 from cuviper/release-0.1.2
Release 0.1.2
2 parents e0607b0 + 38dacb2 commit f0cadf8

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ on:
33
push:
44
branches: [ main ]
55
pull_request:
6-
branches: [ main ]
76
merge_group:
87

98
jobs:

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "num-primitive"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
description = "Traits for primitive numeric types"
55
repository = "https://github.com/rust-num/num-primitive"
66
license = "MIT OR Apache-2.0"
@@ -9,6 +9,10 @@ categories = ["algorithms", "science", "no-std"]
99
edition = "2024"
1010
rust-version = "1.85"
1111

12+
[package.metadata.release]
13+
allow-branch = ["main"]
14+
sign-tag = true
15+
1216
[features]
1317
default = ["std"]
1418
std = []
@@ -24,7 +28,3 @@ unreachable-pub = "deny"
2428
[lints.rustdoc]
2529
broken-intra-doc-links = "deny"
2630
private-intra-doc-links = "deny"
27-
28-
[package.metadata.release]
29-
allow-branch = ["main"]
30-
sign-tag = true

RELEASES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Release 0.1.2 (2025-12-20)
2+
3+
- Backported `PrimitiveInteger::from_str_radix` from 0.3.4.
4+
15
# Release 0.1.1 (2025-12-11)
26

37
- Link documentation to inherent methods.

src/integer.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use core::num::ParseIntError;
2+
13
use crate::{PrimitiveError, PrimitiveNumber, PrimitiveNumberRef};
24

35
/// Trait for all primitive [integer types], including the supertrait [`PrimitiveNumber`].
@@ -263,6 +265,9 @@ pub trait PrimitiveInteger:
263265
/// Converts an integer from little endian to the target's endianness.
264266
fn from_le(value: Self) -> Self;
265267

268+
/// Parses an integer from a string slice with digits in a given base.
269+
fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>;
270+
266271
/// Returns the logarithm of the number with respect to an arbitrary base, rounded down.
267272
fn ilog(self, base: Self) -> u32;
268273

@@ -537,6 +542,7 @@ macro_rules! impl_integer {
537542
forward! {
538543
fn from_be(value: Self) -> Self;
539544
fn from_le(value: Self) -> Self;
545+
fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>;
540546
}
541547
forward! {
542548
fn checked_add(self, rhs: Self) -> Option<Self>;

0 commit comments

Comments
 (0)