Skip to content

Commit

Permalink
Make data-url no_std compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Feb 17, 2022
1 parent 35653b0 commit 194122c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions data-url/src/forgiving_base64.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! <https://infra.spec.whatwg.org/#forgiving-base64-decode>
use alloc::vec::Vec;

#[derive(Debug)]
pub struct InvalidBase64(InvalidBase64Details);

Expand Down
6 changes: 6 additions & 0 deletions data-url/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
//! assert_eq!(body, b"Hello World!");
//! assert!(fragment.is_none());
//! ```
#![no_std]

#[macro_use]
extern crate alloc;

use alloc::{string::String, vec::Vec};

macro_rules! require {
($condition: expr) => {
Expand Down
5 changes: 3 additions & 2 deletions data-url/src/mime.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::fmt::{self, Write};
use std::str::FromStr;
use alloc::{borrow::ToOwned, string::String, vec::Vec};
use core::fmt::{self, Write};
use core::str::FromStr;

/// <https://mimesniff.spec.whatwg.org/#mime-type-representation>
#[derive(Debug, PartialEq, Eq)]
Expand Down

0 comments on commit 194122c

Please sign in to comment.