Skip to content

Commit 4ca8fd3

Browse files
committed
Make data-url no_std compatible
1 parent 9706182 commit 4ca8fd3

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

data-url/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ edition = "2018"
99
autotests = false
1010

1111
[dependencies]
12-
matches = "0.1"
12+
matches = "0.1.9"
1313

1414
[dev-dependencies]
1515
rustc-test = "0.3"

data-url/src/forgiving_base64.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! <https://infra.spec.whatwg.org/#forgiving-base64-decode>
22
3+
use alloc::vec::Vec;
4+
35
#[derive(Debug)]
46
pub struct InvalidBase64(InvalidBase64Details);
57

data-url/src/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@
1515
//! assert!(fragment.is_none());
1616
//! ```
1717
18+
#![no_std]
19+
#[macro_use]
20+
extern crate alloc;
21+
1822
#[macro_use]
1923
extern crate matches;
2024

25+
use alloc::{string::String, vec::Vec};
26+
2127
macro_rules! require {
2228
($condition: expr) => {
2329
if !$condition {

data-url/src/mime.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
use std::fmt::{self, Write};
2-
use std::str::FromStr;
1+
use alloc::{borrow::ToOwned, string::String, vec::Vec};
2+
use core::fmt::{self, Write};
3+
use core::str::FromStr;
34

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

0 commit comments

Comments
 (0)