فهرست منبع

Update crates/cashu/src/nuts/nut18.rs

Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com>
thesimplekid 1 ماه پیش
والد
کامیت
be1e048f2c
1فایلهای تغییر یافته به همراه1 افزوده شده و 5 حذف شده
  1. 1 5
      crates/cashu/src/nuts/nut18.rs

+ 1 - 5
crates/cashu/src/nuts/nut18.rs

@@ -117,11 +117,7 @@ impl TransportBuilder {
 
     /// Add a tag
     pub fn add_tag(mut self, tag: Vec<String>) -> Self {
-        if let Some(ref mut tags) = self.tags {
-            tags.push(tag);
-        } else {
-            self.tags = Some(vec![tag]);
-        }
+        self.tags.get_or_insert_with(Vec::new).push(tag);
         self
     }