Skip to content

Commit 986cdfc

Browse files
committed
use impl ToString instead of String in enable_category
1 parent ee22092 commit 986cdfc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/hello.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ impl eframe::App for MyApp {
4141
.max_log_length(2000) // sets maximum log messages to be retained, default is 1000
4242
// Since we set "show_all_categories" to false in `main`, we should enable some
4343
// categories to be shown by default.
44-
.enable_category("hello".into(), true)
45-
.enable_category("egui_glow::painter".into(), true)
44+
.enable_category("hello", true)
45+
.enable_category("egui_glow::painter", true)
4646
.show(ui)
4747
});
4848
}

src/ui.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,13 @@ impl LoggerUi {
222222
/// # Panics
223223
/// Panics if the lock to the logger could not be acquired.
224224
#[inline]
225-
pub fn enable_category(self, category: String, enable: bool) -> Self {
225+
pub fn enable_category(self, category: impl ToString, enable: bool) -> Self {
226226
LOGGER
227227
.lock()
228228
.as_mut()
229229
.expect("could not lock LOGGER")
230230
.categories
231-
.insert(category, enable);
231+
.insert(category.to_string(), enable);
232232
self
233233
}
234234

0 commit comments

Comments
 (0)