Repository: bevyengine/bevy
File: crates/bevy_asset/src/processor/mod.rs (Rust)

Code before:
        path: impl Into<AssetPath<'_>>,
    ) -> Result<(), WriteDefaultMetaError> {
        let path = path.into();
        let Some(processor) = path
            .get_full_extension()
            .and_then(|extension| self.get_default_processor(&extension))
        else {
            return self
                .server
                .write_default_loader_meta_file_for_path(path)
                .await;
        };

        let meta = processor.default_meta();
        let serialized_meta = meta.serialize();

        let source = self.get_source(path.source())?;

        // Note: we get the reader rather than the processed reader, since we want to write the meta
        // file for the unprocessed version of that asset (so it will be processed by the default
        // processor).
        let reader = source.reader();
        match reader.read_meta_bytes(path.path()).await {
            Ok(_) => return Err(WriteDefaultMetaError::MetaAlreadyExists),
            Err(AssetReaderError::NotAllowed(_)) | Err(AssetReaderError::NotFound(_)) => {
                // The meta file either asn't allowed or couldn't be found so just fall through.
            }
            Err(AssetReaderError::Io(err)) => {
                return Err(WriteDefaultMetaError::IoErrorFromExistingMetaCheck(err))
            }
            Err(AssetReaderError::HttpError(err)) => {
                return Err(WriteDefaultMetaError::HttpErrorFromExistingMetaCheck(err))
            }
        }

        let writer = source.writer()?;
        writer
            .write_meta_bytes(path.path(), &serialized_meta)
            .await?;

        Ok(())
    }

    async fn handle_asset_source_event(&self, source: &AssetSource, event: AssetSourceEvent) {
        trace!("{event:?}");
        match event {
            AssetSourceEvent::AddedAsset(path)
            | AssetSourceEvent::AddedMeta(path)
            | AssetSourceEvent::ModifiedAsset(path)
            | AssetSourceEvent::ModifiedMeta(path) => {
                self.process_asset(source, path).await;

Review comment (suggestion):
```suggestion
                // The meta file either isn't allowed or couldn't be found so just fall through.
```

Code after:
        path: impl Into<AssetPath<'_>>,
    ) -> Result<(), WriteDefaultMetaError> {
        let path = path.into();
        let Some(processor) = path
            .get_full_extension()
            .and_then(|extension| self.get_default_processor(&extension))
        else {
            return self
                .server
                .write_default_loader_meta_file_for_path(path)
                .await;
        };

        let meta = processor.default_meta();
        let serialized_meta = meta.serialize();

        let source = self.get_source(path.source())?;

        // Note: we get the reader rather than the processed reader, since we want to write the meta
        // file for the unprocessed version of that asset (so it will be processed by the default
        // processor).
        let reader = source.reader();
        match reader.read_meta_bytes(path.path()).await {
            Ok(_) => return Err(WriteDefaultMetaError::MetaAlreadyExists),
            Err(AssetReaderError::NotFound(_)) => {
                // The meta file couldn't be found so just fall through.
            }
            Err(AssetReaderError::Io(err)) => {
                return Err(WriteDefaultMetaError::IoErrorFromExistingMetaCheck(err))
            }
            Err(AssetReaderError::HttpError(err)) => {
                return Err(WriteDefaultMetaError::HttpErrorFromExistingMetaCheck(err))
            }
        }

        let writer = source.writer()?;
        writer
            .write_meta_bytes(path.path(), &serialized_meta)
            .await?;

        Ok(())
    }

    async fn handle_asset_source_event(&self, source: &AssetSource, event: AssetSourceEvent) {
        trace!("{event:?}");
        match event {
            AssetSourceEvent::AddedAsset(path)
            | AssetSourceEvent::AddedMeta(path)
            | AssetSourceEvent::ModifiedAsset(path)
            | AssetSourceEvent::ModifiedMeta(path) => {
                self.process_asset(source, path).await;