Repository: sharkdp/bat
File: src/syntax_mapping.rs (Rust)

Code before:
            .insert("**/.ssh/config", MappingTarget::MapTo("SSH Config"))
            .unwrap();
        mapping
            .insert(
                "**/bat/config",
                MappingTarget::MapTo("Bourne Again Shell (bash)"),
            )
            .unwrap();
        mapping
            .insert(
                "/etc/profile",
                MappingTarget::MapTo("Bourne Again Shell (bash)"),
            )
            .unwrap();
        mapping
            .insert("*.pac", MappingTarget::MapTo("JavaScript (Babel)"))
            .unwrap();

        // See #1008
        mapping
            .insert("rails", MappingTarget::MapToUnknown)
            .unwrap();

        // Nginx and Apache syntax files both want to style all ".conf" files
        // see #1131 and #1137
        // Support general syntax highlighting for .conf files if exact match is found, resolves issue #1703
        mapping
            .insert("*.conf", MappingTarget::MapExtensionToUnknown)
            .unwrap();

        for glob in &[
            "/etc/nginx/**/*.conf",
            "/etc/nginx/sites-*/**/*",
            "nginx.conf",
            "mime.types",
        ] {
            mapping.insert(glob, MappingTarget::MapTo("nginx")).unwrap();
        }

        for glob in &[
            "/etc/apache2/**/*.conf",
            "/etc/apache2/sites-*/**/*",
            "httpd.conf",
        ] {
            mapping
                .insert(glob, MappingTarget::MapTo("Apache Conf"))
                .unwrap();
        }

        for glob in &[
            "**/systemd/**/*.conf",

Review comment (suggestion):
I think we can skip adding this comment since we  document the `MapExtensionToUnknown` variant instead

Code after:
    pub fn empty() -> SyntaxMapping<'a> {
        Default::default()
    }

    pub fn builtin() -> SyntaxMapping<'a> {
        let mut mapping = Self::empty();
        mapping.insert("*.h", MappingTarget::MapTo("C++")).unwrap();
        mapping.insert("*.fs", MappingTarget::MapTo("F#")).unwrap();
        mapping
            .insert("build", MappingTarget::MapToUnknown)
            .unwrap();
        mapping
            .insert("**/.ssh/config", MappingTarget::MapTo("SSH Config"))
            .unwrap();
        mapping
            .insert(
                "**/bat/config",
                MappingTarget::MapTo("Bourne Again Shell (bash)"),
            )
            .unwrap();
        mapping
            .insert(
                "/etc/profile",
                MappingTarget::MapTo("Bourne Again Shell (bash)"),
            )
            .unwrap();
        mapping
            .insert("*.pac", MappingTarget::MapTo("JavaScript (Babel)"))
            .unwrap();

        // See #1008
        mapping
            .insert("rails", MappingTarget::MapToUnknown)
            .unwrap();

        // Nginx and Apache syntax files both want to style all ".conf" files
        // see #1131 and #1137
        mapping
            .insert("*.conf", MappingTarget::MapExtensionToUnknown)
            .unwrap();

        for glob in &[
            "/etc/nginx/**/*.conf",
            "/etc/nginx/sites-*/**/*",
            "nginx.conf",
            "mime.types",
        ] {
            mapping.insert(glob, MappingTarget::MapTo("nginx")).unwrap();
        }

        for glob in &[