Browse Source

Merge pull request #1120 from blink1073/array-pattern

Update patterns tutorial
Afshin Darian 8 năm trước cách đây
mục cha
commit
bbbacc9f29
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      tutorial/patterns.md

+ 2 - 1
tutorial/patterns.md

@@ -106,7 +106,8 @@ Prefer an `Array` for:
 - A return value is the result of a newly allocated array, to avoid the 
 extra allocation of an iterator.  
 - A signal payload.
-- A public attribute that is inherently static.
+- A public attribute that is inherently static.  Use `.slice()` to
+make sure the internal value cannot be mutated by the consumer.
 
 Prefer an `IIterator` for:
 - A return value where the value is based on an internal `Vector` but the