Skip to content

Commit

Permalink
leave nightly requirement for now
Browse files Browse the repository at this point in the history
  • Loading branch information
knickish committed Jul 25, 2024
1 parent d28e068 commit 12c59bb
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ For more examples take a look at [tests](/tests)

All features are enabled by default. To enable only specific formats, import nanoserde using
```toml
nanoserde = { version = "*", default-features = false, features = [] }
nanoserde = { version = "*", default-features = false, features = ["std", "{format feature name}"] }
```
in your `Cargo.toml` and add one or more of the following crate features:

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
//! For `#[nserde(..)]` supported attributes for each format check [Features support matrix](https://github.com/not-fl3/nanoserde#features-support-matrix)
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(error_in_core))]

Check warning on line 19 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Individual Features NoStd (toml)

the feature `error_in_core` has been stable since 1.82.0-nightly and no longer requires an attribute to enable

Check warning on line 19 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Individual Features NoStd (binary)

the feature `error_in_core` has been stable since 1.82.0-nightly and no longer requires an attribute to enable

Check warning on line 19 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Individual Features NoStd (ron)

the feature `error_in_core` has been stable since 1.82.0-nightly and no longer requires an attribute to enable

Check warning on line 19 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test Individual Features NoStd (json)

the feature `error_in_core` has been stable since 1.82.0-nightly and no longer requires an attribute to enable

Check warning on line 19 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test No Std (ubuntu-latest, x86_64-unknown-linux-gnu)

the feature `error_in_core` has been stable since 1.82.0-nightly and no longer requires an attribute to enable

extern crate alloc;

Expand Down
8 changes: 7 additions & 1 deletion src/serde_bin.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
use core::convert::TryInto;

// remove this after 1.81 is live
#[cfg(not(feature = "std"))]
use core::error::Error;
#[cfg(feature = "std")]
use std::error::Error;

use alloc::borrow::ToOwned;
use alloc::boxed::Box;
use alloc::collections::{BTreeMap, BTreeSet, LinkedList};
Expand Down Expand Up @@ -77,7 +83,7 @@ impl core::fmt::Display for DeBinErr {
}
}

impl core::error::Error for DeBinErr {}
impl Error for DeBinErr {}

macro_rules! impl_ser_de_bin_for {
($ty:ident) => {
Expand Down
8 changes: 7 additions & 1 deletion src/serde_json.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
use core::str::Chars;

// remove this after 1.81 is live
#[cfg(not(feature = "std"))]
use core::error::Error;
#[cfg(feature = "std")]
use std::error::Error;

use alloc::boxed::Box;
use alloc::collections::{BTreeMap, BTreeSet, LinkedList};
use alloc::format;
Expand Down Expand Up @@ -160,7 +166,7 @@ impl core::fmt::Display for DeJsonErr {
}
}

impl core::error::Error for DeJsonErr {}
impl Error for DeJsonErr {}

impl DeJsonState {
pub fn next(&mut self, i: &mut Chars) {
Expand Down
8 changes: 7 additions & 1 deletion src/serde_ron.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
use core::str::Chars;

// remove this after 1.81 is live
#[cfg(not(feature = "std"))]
use core::error::Error;
#[cfg(feature = "std")]
use std::error::Error;

use alloc::boxed::Box;
use alloc::collections::{BTreeMap, BTreeSet, LinkedList};
use alloc::format;
Expand Down Expand Up @@ -157,7 +163,7 @@ impl core::fmt::Display for DeRonErr {
}
}

impl core::error::Error for DeRonErr {}
impl Error for DeRonErr {}

impl DeRonState {
pub fn next(&mut self, i: &mut Chars) {
Expand Down
8 changes: 7 additions & 1 deletion src/toml.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
use core::str::Chars;

// remove this after 1.81 is live
#[cfg(not(feature = "std"))]
use core::error::Error;
#[cfg(feature = "std")]
use std::error::Error;

use alloc::format;
use alloc::string::{String, ToString};
use alloc::{collections::BTreeMap, vec, vec::Vec};
Expand Down Expand Up @@ -249,7 +255,7 @@ impl Out {
}
}

impl core::error::Error for TomlErr {}
impl Error for TomlErr {}

impl TomlParser {
/// Parse a TOML string.
Expand Down

0 comments on commit 12c59bb

Please sign in to comment.