Skip to content

Commit f369e95

Browse files
authored
Merge pull request #19 from cuviper/release-0.2.4
Release 0.2.4
2 parents 6534cfb + a2f8e04 commit f369e95

5 files changed

Lines changed: 17 additions & 8 deletions

File tree

.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.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.2.3"
3+
version = "0.2.4"
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.87"
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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![crate](https://img.shields.io/crates/v/num-primitive.svg)](https://crates.io/crates/num-primitive)
44
[![documentation](https://docs.rs/num-primitive/badge.svg)](https://docs.rs/num-primitive)
5-
[![minimum rustc 1.85](https://img.shields.io/badge/rustc-1.85+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
5+
[![minimum rustc 1.87](https://img.shields.io/badge/rustc-1.87+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
66
[![build status](https://github.com/rust-num/num-primitive/workflows/CI/badge.svg)](https://github.com/rust-num/num-primitive/actions)
77

88
Traits for primitive numeric types in Rust.
@@ -61,7 +61,7 @@ Release notes are available in [RELEASES.md](RELEASES.md).
6161

6262
## Compatibility
6363

64-
The `num-primitive` crate is currently tested for Rust 1.85 and greater. This
64+
The `num-primitive` crate is currently tested for Rust 1.87 and greater. This
6565
minimum-supported Rust version (MSRV) may be increased at any time to add
6666
support for newly-stabilized functionality from the standard library. Changes
6767
will be documented prominently in the release notes.

RELEASES.md

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

37
- Updated to MSRV 1.87.

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

@@ -543,6 +548,7 @@ macro_rules! impl_integer {
543548
forward! {
544549
fn from_be(value: Self) -> Self;
545550
fn from_le(value: Self) -> Self;
551+
fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>;
546552
}
547553
forward! {
548554
fn checked_add(self, rhs: Self) -> Option<Self>;

0 commit comments

Comments
 (0)