Skip to main content

transpile

Function transpile 

Source
pub fn transpile(
    source: &str,
    target: &str,
    code: &str,
) -> Result<String, TranspileError>
Examples found in repository?
examples/basic.rs (line 7)
1fn main() -> Result<(), Box<dyn std::error::Error>> {
2    let go = r#"package main
3func add(a int, b int) int {
4    return a + b
5}
6"#;
7    println!("{}", code_transpiler::transpile("go", "rust", go)?);
8    Ok(())
9}