# Rust의 완전 구조 분해: 필드 추가 시 컴파일러가 알려주는 안전한 코드

Original title: In Praise of Exhaustive Destructuring

> Hacker News story 48879529 · language: ko · submitted 2026-07-12
> Web version: https://zeli.app/ko/story/48879529
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 50 · by [avandecreme](<https://news.ycombinator.com/user?id=avandecreme>) · 💬 7
[original](<https://antoine.vandecreme.net/blog/exhaustive-destructuring-praise/>) · [HN discussion](<https://news.ycombinator.com/item?id=48879529>)

## Summary

Rust에서 구조체를 역구조화할 때 모든 필드를 나열하거나 `..`를 사용해야 하는 불편함을 겪었던 저자는, 최근에는 필드 접근을 위해 `.` 문법보다 구조체 역구조화를 선호하게 되었다. 그 이유는 구조체에 필드가 추가될 때 컴파일러가 경고를 주어 유지보수가 더 안전해지기 때문이다. 예를 들어, 기상 데이터 구조체에 풍속 필드를 추가하면, 기존의 `is_dangerous` 함수는 경고 없이 통과하지만, 역구조화를 사용하면 `error[E0027]`로 필드 누락을 알려준다. 이 기법은 CRUD 웹 서비스의 계층 간 변환에서 유용하며, TypeScript와 Haskell의 대안도 소개한다.

## Key quote

> 좋은 소식은, 우리가 함수를 이렇게 작성했다면 경고를 받을 수 있었다는 것입니다.

---

## Cite

- Page: https://zeli.app/ko/story/48879529
- Date: 2026-07-12
- Source: antoine.vandecreme.net (https://antoine.vandecreme.net/blog/exhaustive-destructuring-praise/)
- Hacker News: https://news.ycombinator.com/item?id=48879529

## Other languages

- en: https://zeli.app/story/48879529 · markdown: https://zeli.app/story/48879529.md
- zh: https://zeli.app/zh/story/48879529 · markdown: https://zeli.app/zh/story/48879529.md
- ja: https://zeli.app/ja/story/48879529 · markdown: https://zeli.app/ja/story/48879529.md
- de: https://zeli.app/de/story/48879529 · markdown: https://zeli.app/de/story/48879529.md
- es: https://zeli.app/es/story/48879529 · markdown: https://zeli.app/es/story/48879529.md
