(
object: &ProjectObject,
project_dir: &Utf8PlatformPath,
target_obj_dir: Option<&Utf8PlatformPath>,
base_obj_dir: Option<&Utf8PlatformPath>,
)
| 111 | |
| 112 | impl 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] |
nothing calls this directly
no test coverage detected