Merge pull request #1306 from hannobraun/update

Upgrade to Rust 1.65.0
This commit is contained in:
Hanno Braun 2022-11-04 09:58:49 +01:00 committed by GitHub
commit 8cf82e9803
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -19,7 +19,7 @@ impl<'a> From<&'a &dyn crate::models::Context> for Context<'a> {
let ctx = &*(user_data as *const &dyn crate::models::Context); let ctx = &*(user_data as *const &dyn crate::models::Context);
match std::panic::catch_unwind(AssertUnwindSafe(|| { match std::panic::catch_unwind(AssertUnwindSafe(|| {
ctx.get_argument(&*name) ctx.get_argument(&name)
})) { })) {
Ok(Some(arg)) => StringSlice::from_str(arg), Ok(Some(arg)) => StringSlice::from_str(arg),
Ok(None) => StringSlice::from_str(""), Ok(None) => StringSlice::from_str(""),

View File

@ -173,7 +173,7 @@ impl Deref for String {
fn deref(&self) -> &Self::Target { fn deref(&self) -> &Self::Target {
// Safety: The only way to create a FfiSafeString is from a valid Rust // Safety: The only way to create a FfiSafeString is from a valid Rust
// string, so we can skip the UTF-8 checks. // string, so we can skip the UTF-8 checks.
unsafe { std::str::from_utf8_unchecked(&*self.0) } unsafe { std::str::from_utf8_unchecked(&self.0) }
} }
} }
@ -296,7 +296,7 @@ impl Deref for StringSlice {
fn deref(&self) -> &Self::Target { fn deref(&self) -> &Self::Target {
// Safety: the only way you can construct a StringSlice is via a string. // Safety: the only way you can construct a StringSlice is via a string.
unsafe { std::str::from_utf8_unchecked(&*self.0) } unsafe { std::str::from_utf8_unchecked(&self.0) }
} }
} }

View File

@ -121,7 +121,7 @@ fn on_panic(payload: Box<dyn Any + Send>) -> ! {
if let Some(s) = payload.downcast_ref::<std::string::String>() { if let Some(s) = payload.downcast_ref::<std::string::String>() {
s.as_str() s.as_str()
} else if let Some(s) = payload.downcast_ref::<&str>() { } else if let Some(s) = payload.downcast_ref::<&str>() {
*s s
} else { } else {
"A panic occurred" "A panic occurred"
}; };

View File

@ -1,4 +1,4 @@
[toolchain] [toolchain]
channel = "1.64.0" channel = "1.65.0"
components = ["rustfmt", "clippy"] components = ["rustfmt", "clippy"]
targets = ["wasm32-unknown-unknown"] targets = ["wasm32-unknown-unknown"]