fix bad transmute (???) and extern crate test

This commit is contained in:
bendn 2024-05-18 19:06:00 +07:00
parent 0dffa5bc99
commit 293121e5f5
No known key found for this signature in database
GPG key ID: 0D9D3A2A3B2A93D6
3 changed files with 2 additions and 4 deletions

View file

@ -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"

View file

@ -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()) };

View file

@ -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),
) )
}; };