Skip to content

Commit

Permalink
docs: mention extension must start with a . in with_extension (#313)
Browse files Browse the repository at this point in the history
Fix comment
  • Loading branch information
NicholasLYang authored Nov 22, 2024
1 parent be378d8 commit 417f534
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,16 @@ impl ResolveOptions {
self
}

/// Adds a single extension to the list of extensions
/// Adds a single extension to the list of extensions. Extension must start with a `.`
///
/// ## Examples
///
/// ```
/// use oxc_resolver::ResolveOptions;
/// use std::path::{Path, PathBuf};
///
/// let options = ResolveOptions::default().with_extension("jsonc");
/// assert!(options.extensions.contains(&"jsonc".to_string()));
/// let options = ResolveOptions::default().with_extension(".jsonc");
/// assert!(options.extensions.contains(&".jsonc".to_string()));
/// ```
#[must_use]
pub fn with_extension<S: Into<String>>(mut self, extension: S) -> Self {
Expand Down

0 comments on commit 417f534

Please # to comment.