From f30cb168dfaa1f0bc89fceef3e226e24e9733590 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Thu, 11 Jul 2024 15:43:51 -0400 Subject: [PATCH] chore: update rust to v1.79.0 --- rust-toolchain.toml | 2 +- src/ffi.rs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 2fe891c..7ae2b72 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.77.0" +channel = "1.79.0" profile = "default" diff --git a/src/ffi.rs b/src/ffi.rs index 94fc93f..a7bab7d 100644 --- a/src/ffi.rs +++ b/src/ffi.rs @@ -4,6 +4,9 @@ use core::ffi::{c_char, c_uint}; #[cfg(feature = "std")] extern crate std; +#[cfg(feature = "std")] +use std::fmt::Display; + #[repr(C)] pub struct ada_url { _unused: [u8; 0], @@ -42,9 +45,9 @@ impl AsRef for ada_owned_string { } #[cfg(feature = "std")] -impl ToString for ada_owned_string { - fn to_string(&self) -> std::string::String { - self.as_ref().to_owned() +impl Display for ada_owned_string { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{}", self.as_ref().to_owned()) } }