Method
format
(&mut self, request: SyncFormatRequest<Configuration>, _format_with_host: impl FnMut(SyncHostFormatRequest) -> FormatResult)
Source from the content-addressed store, hash-verified
| 49 | } |
| 50 | |
| 51 | fn format(&mut self, request: SyncFormatRequest<Configuration>, _format_with_host: impl FnMut(SyncHostFormatRequest) -> FormatResult) -> FormatResult { |
| 52 | if request.range.is_some() { |
| 53 | return Ok(None); |
| 54 | } |
| 55 | let Ok(source) = std::str::from_utf8(&request.file_bytes) else { |
| 56 | return Ok(None); |
| 57 | }; |
| 58 | let output = crate::format(&self.allocator, request.file_path, source, request.config); |
| 59 | self.allocator.reset(); |
| 60 | Ok(output.map(String::into_bytes)) |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | generate_plugin_code!( |
Tested by
no test coverage detected