Skip to content

Commit

Permalink
Merge pull request #16 from dtolnay/alloc
Browse files Browse the repository at this point in the history
Drop dependency on std
  • Loading branch information
dtolnay authored Jul 16, 2022
2 parents 39935f5 + 73a7d7a commit 2e41003
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ categories = ["encoding"]
readme = "README.md"

[dependencies]
serde = "1.0"
serde = { version = "1.0", default-features = false, features = ["alloc"] }

[dev-dependencies]
serde_derive = "1.0"
Expand Down
8 changes: 7 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,17 @@
//! # fn main() { try_main().unwrap() }
//! ```
#![no_std]
#![doc(html_root_url = "https://docs.rs/serde_ignored/0.1.3")]
#![allow(clippy::missing_errors_doc)]

extern crate alloc;

use alloc::borrow::ToOwned;
use alloc::string::{String, ToString};
use alloc::vec::Vec;
use core::fmt::{self, Display};
use serde::de::{self, Deserialize, DeserializeSeed, Visitor};
use std::fmt::{self, Display};

/// Entry point. See crate documentation for an example.
pub fn deserialize<'de, D, F, T>(deserializer: D, mut callback: F) -> Result<T, D::Error>
Expand Down

0 comments on commit 2e41003

Please sign in to comment.