egui/epaint
David Pedersen 02a62d1986
Replace impl Into<String> with impl ToString (#302)
* Replace `impl Into<String>` with `impl ToString`

This is something I ran into today. Types that implement
`std::fmt::Display` cannot be passed to functions that take `impl
Into<String>`. You have to call `display_thing.to_string()`. Its a small
thing but would be fixed by instead taking `impl ToString`.

Afaik `impl ToString` is a superset of `impl Into<String>`, unless users
manually implement `Into<String> for T` (or `From<T> for String`) for
their own types. However I think its more common to implement `Display`
as that works with `println` and friends. The main difference is that
`Display::fmt` can return errors but thats also quite rare in my
experience.

I did some testing in a [playground] and seems to work.

[playground]: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=1111e071f6ae416ae2688d58d2e9b575

* Silence warnings
2021-04-29 19:49:49 +02:00
..
fonts Break out mod paint into new crate epaint 2021-01-10 15:42:46 +01:00
src Replace impl Into<String> with impl ToString (#302) 2021-04-29 19:49:49 +02:00
Cargo.toml Release 0.11.0 - Optimization, screen reader & new layout logic 2021-04-05 14:49:06 +02:00
README.md Rename Egui to egui 2021-01-17 14:48:59 +01:00

epaint - egui paint library

A bare-bones 2D graphics library for turning simple 2D shapes and text into textured triangles.

Made for egui.