Skip to content
Merged
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
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
merge_group:

jobs:
Expand Down
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "num-primitive"
version = "0.2.3"
version = "0.2.4"
description = "Traits for primitive numeric types"
repository = "https://github.com/rust-num/num-primitive"
license = "MIT OR Apache-2.0"
Expand All @@ -9,6 +9,10 @@ categories = ["algorithms", "science", "no-std"]
edition = "2024"
rust-version = "1.87"

[package.metadata.release]
allow-branch = ["main"]
sign-tag = true

[features]
default = ["std"]
std = []
Expand All @@ -24,7 +28,3 @@ unreachable-pub = "deny"
[lints.rustdoc]
broken-intra-doc-links = "deny"
private-intra-doc-links = "deny"

[package.metadata.release]
allow-branch = ["main"]
sign-tag = true
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![crate](https://img.shields.io/crates/v/num-primitive.svg)](https://crates.io/crates/num-primitive)
[![documentation](https://docs.rs/num-primitive/badge.svg)](https://docs.rs/num-primitive)
[![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)
[![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)
[![build status](https://github.com/rust-num/num-primitive/workflows/CI/badge.svg)](https://github.com/rust-num/num-primitive/actions)

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

## Compatibility

The `num-primitive` crate is currently tested for Rust 1.85 and greater. This
The `num-primitive` crate is currently tested for Rust 1.87 and greater. This
minimum-supported Rust version (MSRV) may be increased at any time to add
support for newly-stabilized functionality from the standard library. Changes
will be documented prominently in the release notes.
Expand Down
4 changes: 4 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Release 0.2.4 (2025-12-20)

- Backported `PrimitiveInteger::from_str_radix` from 0.3.4.

# Release 0.2.3 (2025-12-16)

- Updated to MSRV 1.87.
Expand Down
6 changes: 6 additions & 0 deletions src/integer.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use core::num::ParseIntError;

use crate::{PrimitiveError, PrimitiveNumber, PrimitiveNumberRef};

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

/// Parses an integer from a string slice with digits in a given base.
fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>;

/// Returns the logarithm of the number with respect to an arbitrary base, rounded down.
fn ilog(self, base: Self) -> u32;

Expand Down Expand Up @@ -543,6 +548,7 @@ macro_rules! impl_integer {
forward! {
fn from_be(value: Self) -> Self;
fn from_le(value: Self) -> Self;
fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>;
}
forward! {
fn checked_add(self, rhs: Self) -> Option<Self>;
Expand Down