-
Notifications
You must be signed in to change notification settings - Fork 802
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Stop panic on fmt::Display
#3062
Conversation
I think you need to fully qualify it, e.g. impl<$($generics,)*> ::std::fmt::Display for $name {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>)
-> ::std::result::Result<(), ::std::fmt::Error>
{
let s = self.str().or(::std::result::Result::Err(::std::fmt::Error))?;
::std::write!(f, "{}", s.to_string_lossy())
}
} |
thanks, done. |
16d6761
to
52dca88
Compare
52dca88
to
9295f81
Compare
9295f81
to
5aff2cc
Compare
Sorry for the many force pushes: I took a detour adding a new API impl Python<'_> {
pub fn try_with_gil<F, R>(f: F) -> Option<R>
where
F: for<'py> FnOnce(Python<'py>) -> R,
{
gil::try_ensure_gil().map(|gil| f(unsafe { gil.python() }))
}
} because I did not realise that I already had implicit access to the GIL in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, thanks!
bors r=davidhewitt |
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Closes #3060