Skip to content

Commit a1b806b

Browse files
committed
Bumped MSRV to 1.80 in order to use str::split_at_checked
1 parent 6a7102e commit a1b806b

File tree

5 files changed

+8
-11
lines changed

5 files changed

+8
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
include:
2424
# Test MSRV
25-
- rust: 1.62.0 # keep in sync with manifest rust-version
25+
- rust: 1.80 # keep in sync with manifest rust-version
2626
TARGET: x86_64-unknown-linux-gnu
2727

2828
# Test nightly but don't fail

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ categories = ["no-std"]
44
description = "serde-json for no_std programs"
55
documentation = "https://docs.rs/serde-json-core"
66
edition = "2018"
7-
rust-version = "1.62.0" # keep in sync with ci, src/lib.rs, and README
7+
rust-version = "1.80" # keep in sync with ci, src/lib.rs, and README
88
keywords = ["serde", "json"]
99
license = "MIT OR Apache-2.0"
1010
name = "serde-json-core"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This project is developed and maintained by the [rust-embedded-community].
1212

1313
## Minimum Supported Rust Version (MSRV)
1414

15-
This crate is guaranteed to compile on stable Rust 1.62.0 and up. It *might*
15+
This crate is guaranteed to compile on stable Rust 1.80 and up. It *might*
1616
compile with older versions but that may change in any new patch release.
1717

1818
## License

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
//!
5353
//! # Minimum Supported Rust Version (MSRV)
5454
//!
55-
//! This crate is guaranteed to compile on stable Rust 1.62.0 and up. It *might* compile with older
55+
//! This crate is guaranteed to compile on stable Rust 1.80 and up. It *might* compile with older
5656
//! versions but that may change in any new patch release.
5757
5858
// #![deny(missing_docs)]

src/str.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,10 @@ fn unescape_next_fragment(
2525
Some('r') => '\r',
2626
Some('t') => '\t',
2727
Some('u') => {
28-
fn split_first_slice(s: &str, len: usize) -> Option<(&str, &str)> {
29-
Some((s.get(..len)?, s.get(len..)?))
30-
}
31-
32-
let (escape_sequence, remaining_escaped_string_chars) =
33-
split_first_slice(escaped_string_chars.as_str(), 4)
34-
.ok_or(StringUnescapeError::InvalidEscapeSequence)?;
28+
let (escape_sequence, remaining_escaped_string_chars) = escaped_string_chars
29+
.as_str()
30+
.split_at_checked(4)
31+
.ok_or(StringUnescapeError::InvalidEscapeSequence)?;
3532

3633
escaped_string_chars = remaining_escaped_string_chars.chars();
3734

0 commit comments

Comments
 (0)