Skip to content

Commit

Permalink
avoid panic
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Mar 19, 2024
1 parent 8bb58bb commit aba7717
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/turbopack-css/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{
sync::{Arc, RwLock},
};

use anyhow::{Context, Result};
use anyhow::{bail, Context, Result};
use indexmap::IndexMap;
use lightningcss::{
css_modules::{CssModuleExport, CssModuleExports, CssModuleReference, Pattern, Segment},
Expand Down Expand Up @@ -368,7 +368,7 @@ pub async fn process_css_with_placeholder(
let code = code.await?;
let code = match &*code {
FileContent::Content(v) => v.content().to_str()?,
_ => unreachable!("this case should be filtered out while parsing"),
_ => bail!("this case should be filtered out while parsing"),
};

let (result, _) = stylesheet.to_css(cm.clone(), &code, false, false, false)?;
Expand Down

0 comments on commit aba7717

Please sign in to comment.