MCPcopy Create free account
hub / github.com/RustOtomeLab/RustEng / from_weak

Method from_weak

src/config/character_volume.rs:31–42  ·  view source on GitHub ↗
(weak: Weak<MainWindow>)

Source from the content-addressed store, hash-verified

29 }
30
31 pub(crate) fn from_weak(weak: Weak<MainWindow>) -> Self {
32 if let Some(window) = weak.upgrade() {
33 let model = window.get_character_volumes();
34 let volumes = (0..model.row_count())
35 .filter_map(|i| model.row_data(i))
36 .map(|item| (item.name.to_string(), item.volume))
37 .collect();
38 CharacterVolumeConfig { volumes }
39 } else {
40 unreachable!()
41 }
42 }
43}
44
45impl Executor {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected