mirror of
https://github.com/bend-n/fimg.git
synced 2024-12-22 02:28:19 -06:00
fix bad transmute (???) and extern crate test
This commit is contained in:
parent
0dffa5bc99
commit
293121e5f5
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "fimg"
|
name = "fimg"
|
||||||
version = "0.4.42"
|
version = "0.4.43"
|
||||||
authors = ["bend-n <bend.n@outlook.com>"]
|
authors = ["bend-n <bend.n@outlook.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
|
@ -19,8 +19,6 @@ fn b64() {
|
||||||
t("Hello World", "SGVsbG8gV29ybGQ=");
|
t("Hello World", "SGVsbG8gV29ybGQ=");
|
||||||
}
|
}
|
||||||
|
|
||||||
extern crate test;
|
|
||||||
|
|
||||||
pub fn encode(i: &[u8]) -> String {
|
pub fn encode(i: &[u8]) -> String {
|
||||||
let mut x = Vec::with_capacity(size(i));
|
let mut x = Vec::with_capacity(size(i));
|
||||||
unsafe { portable(i, x.as_mut_ptr()) };
|
unsafe { portable(i, x.as_mut_ptr()) };
|
||||||
|
|
|
@ -57,7 +57,7 @@ where
|
||||||
};
|
};
|
||||||
(o $n:literal) => {
|
(o $n:literal) => {
|
||||||
transmute::<Image<Box<[u8]>, 1>, Image<Box<[u8]>, N>>(
|
transmute::<Image<Box<[u8]>, 1>, Image<Box<[u8]>, N>>(
|
||||||
transmute::<Image<Vec<u8>, N>, Image<&[u8], 1>>(self.as_ref().to_owned())
|
transmute::<Image<Vec<u8>, N>, Image<Vec<u8>, 1>>(self.as_ref().to_owned())
|
||||||
.scale::<scale::Nearest>(w, h),
|
.scale::<scale::Nearest>(w, h),
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue