충격이 너무 커서 댕이가 찾아왔나요
러스트에서 카고를 사용하는데 옵션을 걸면 모듈을 못 찾았는데요. 슬프빈다.
[dependencies.async-std]
version = "1.12.0"
optional = true
features = ["default", "attributes"]
[features]
async-std = ["dep:async-std", "quinn/runtime-async-std"]다른 개발자들은 이케이케 잘 사용하는 것 같아보여요.
[1] How to have an optional dependency enable another optional dependency rust - Stack Overflow
어쩜 이케 된 것이더냐 ..
사실 cargo 내부적으로 옵션을 걸어버리면 기본 모듈을 읽어오지 않는 듯 해요. 연락도 없이 뜸금 .. 나쁘빈다.
문득 생각이 들었쩌. 모듈을 못 읽어오는 것이 아니었고 안 읽어 오는 것이라 말이저. 공식 문서는 대충 읽어서 이런 내용이 있었는지 모르겠어요.
러스트는 cargo.toml 내용에 features 요소로 default 기능들을 명시해줄 수 있어요.
[1] async-std/Cargo.toml at main · async-rs/async-std · GitHub
[features]
default = [
"async-std"
]
async-std = ["dep:async-std", "quinn/runtime-async-std"]밥먹고 와서 계속 댕한 상태로 있었는데 오늘은 망했네요.
