(&mut self)
| 160 | } |
| 161 | |
| 162 | fn make_primitive(&mut self) -> errors::Result<()> { |
| 163 | match utils::primitive_of(self) { |
| 164 | Some(primitive_repr) => { |
| 165 | match *self { |
| 166 | InvocationArg::Java { |
| 167 | instance: _, |
| 168 | ref mut class_name, |
| 169 | serialized: _, |
| 170 | } => *class_name = primitive_repr, |
| 171 | InvocationArg::Rust { |
| 172 | json: _, |
| 173 | ref mut class_name, |
| 174 | serialized: _, |
| 175 | } => *class_name = primitive_repr, |
| 176 | InvocationArg::RustBasic { |
| 177 | instance: _, |
| 178 | ref mut class_name, |
| 179 | serialized: _, |
| 180 | } => *class_name = primitive_repr, |
| 181 | }; |
| 182 | Ok(()) |
| 183 | } |
| 184 | None => Err(errors::J4RsError::JavaError(format!( |
| 185 | "Cannot transform to primitive: {}", |
| 186 | utils::get_class_name(self) |
| 187 | ))), |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | /// Consumes this InvocationArg and transforms it to an InvocationArg that contains a Java primitive, leveraging Java's autoboxing. |
| 192 | /// |
no test coverage detected