[Rust] 다른 파일에 있는 module 사용하기

joonpark·2021년 12월 12일
0

Rust

목록 보기
1/1

main.rs
contact.rs
phonebook.rs

이런 상태에서 phonebook에서 contact를 쓰려고 "mod contact"해주고 main.rs 에서 mod contact; mod phonebook;을 해주면 중복된 contact를 사용한다는 에러 생김.

Why do I get "expected struct file1::A found struct file2::A" error when using a struct in multiple files?

0개의 댓글