mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Merge pull request #852 from teloxide/—alloc
Remove a useless allocation when attaching files
This commit is contained in:
commit
758687a63e
1 changed files with 2 additions and 2 deletions
|
@ -123,8 +123,8 @@ impl InputFile {
|
|||
///
|
||||
/// This is used to coordinate with `attach://`.
|
||||
pub(crate) fn id(&self) -> &str {
|
||||
// FIXME: remove extra alloc
|
||||
self.id.get_or_init(|| uuid::Uuid::new_v4().to_string().into())
|
||||
let random = || Arc::from(&*uuid::Uuid::new_v4().as_simple().encode_lower(&mut [0; 32]));
|
||||
self.id.get_or_init(random)
|
||||
}
|
||||
|
||||
/// Returns `true` if this file needs an attachment i.e. it's not a file_id
|
||||
|
|
Loading…
Reference in a new issue