MCPcopy Index your code
hub / github.com/encounter/objdiff / new

Method new

objdiff-gui/src/app.rs:113–146  ·  view source on GitHub ↗
(
        object: &ProjectObject,
        project_dir: &Utf8PlatformPath,
        target_obj_dir: Option<&Utf8PlatformPath>,
        base_obj_dir: Option<&Utf8PlatformPath>,
    )

Source from the content-addressed store, hash-verified

111
112impl ObjectConfig {
113 pub fn new(
114 object: &ProjectObject,
115 project_dir: &Utf8PlatformPath,
116 target_obj_dir: Option<&Utf8PlatformPath>,
117 base_obj_dir: Option<&Utf8PlatformPath>,
118 ) -> Self {
119 let target_path = if let (Some(target_obj_dir), Some(path), None) =
120 (target_obj_dir, &object.path, &object.target_path)
121 {
122 Some(target_obj_dir.join(path.with_platform_encoding()))
123 } else {
124 object.target_path.as_ref().map(|path| project_dir.join(path.with_platform_encoding()))
125 };
126 let base_path = if let (Some(base_obj_dir), Some(path), None) =
127 (base_obj_dir, &object.path, &object.base_path)
128 {
129 Some(base_obj_dir.join(path.with_platform_encoding()))
130 } else {
131 object.base_path.as_ref().map(|path| project_dir.join(path.with_platform_encoding()))
132 };
133 let source_path =
134 object.source_path().map(|s| project_dir.join(s.with_platform_encoding()));
135 Self {
136 name: object.name().to_string(),
137 target_path,
138 base_path,
139 reverse_fn_order: object.reverse_fn_order(),
140 complete: object.complete(),
141 hidden: object.hidden(),
142 scratch: object.scratch.clone(),
143 source_path,
144 symbol_mappings: object.symbol_mappings.clone().unwrap_or_default(),
145 }
146 }
147}
148
149#[inline]

Callers

nothing calls this directly

Calls 10

deserialize_configFunction · 0.85
source_pathMethod · 0.80
nameMethod · 0.80
reverse_fn_orderMethod · 0.80
completeMethod · 0.80
set_project_dirMethod · 0.80
is_someMethod · 0.80
init_fontsMethod · 0.80
hiddenMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected