From 46eccab2360498da5854e9effc8faba15dd8d9cd Mon Sep 17 00:00:00 2001 From: FedericoBruzzone Date: Wed, 19 Jun 2024 21:55:52 +0200 Subject: [PATCH] Update definition.rs Signed-off-by: FedericoBruzzone --- tdlib-rs-parser/src/tl/definition.rs | 6 +----- tdlib-rs/build.rs | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tdlib-rs-parser/src/tl/definition.rs b/tdlib-rs-parser/src/tl/definition.rs index 5698fd9..88fb2b4 100644 --- a/tdlib-rs-parser/src/tl/definition.rs +++ b/tdlib-rs-parser/src/tl/definition.rs @@ -125,11 +125,7 @@ impl FromStr for Definition { } // Parse `description` - let description = if let Some(description) = docs.remove("description") { - description - } else { - String::new() - }; + let description = docs.remove("description").unwrap_or_default(); // Parse `middle` let params = middle diff --git a/tdlib-rs/build.rs b/tdlib-rs/build.rs index 50b6fb9..b358785 100644 --- a/tdlib-rs/build.rs +++ b/tdlib-rs/build.rs @@ -40,7 +40,7 @@ fn load_tl(file: &str) -> std::io::Result> { .collect()) } - #[cfg(not(any(feature = "docs", feature = "pkg-config", feature = "download-tdlib")))] +#[cfg(not(any(feature = "docs", feature = "pkg-config", feature = "download-tdlib")))] /// Copy all files from a directory to another. fn copy_dir_all(src: impl AsRef, dst: impl AsRef) -> std::io::Result<()> { std::fs::create_dir_all(&dst)?;