Function language_to_string

Source
pub fn language_to_string(language: &Language) -> String
Expand description

Convert a Language enum to its string representation

This function converts a Language enum value to a human-readable string representation. The returned strings use proper capitalization and are suitable for display purposes.

§Arguments

  • language - The Language enum value to convert

§Returns

A string representation of the language name.

§Examples

use tree_parser::{language_to_string, Language};
 
assert_eq!(language_to_string(&Language::Python), "Python");
assert_eq!(language_to_string(&Language::Rust), "Rust");
assert_eq!(language_to_string(&Language::JavaScript), "JavaScript");
assert_eq!(language_to_string(&Language::Cpp), "C++");