String
vs str
์ด์ ๋ฌ์คํธ์ ๋๊ฐ์ง ๋ฌธ์์ด ํ์ ์ ๋ํด์ ์ดํดํด ๋ณด๊ฒ ์ต๋๋ค.:
We can now understand the two string types in Rust:
๋ฌ์คํธ ์ฉ์ด:
&str
ํ์ ์ ๋ฌธ์์ด ์ฌ๋ผ์ด์ค์ ๋ถ๋ณ์ฐธ์กฐ์ ๋๋ค.String
ํ์ ์ ๊ฐ๋ณ ๋ฌธ์์ด ๋ฒํผ์ ๋๋ค.
Rust terminology:
&str
an immutable reference to a string slice.String
a mutable string buffer.
์ญ์ฃผ
- str์ ๋ฌธ์ ๋ฆฌํฐ๋ด, &์ ์ฐธ์กฐ ํ์ ์ ๋๋ค.