Skip to content

答案输出格式问题——变量绑定与解构solutions/variables.md 第4题解法2  #538

@Autumn716

Description

@Autumn716

修改后代码如下:

fn main() {
    let x = define_x();
    println!("{}, world", x);
}

fn define_x() -> &'static str {
    let x = "hello";
    x
}

修改前输出结果为:"hello", world
修改后输出结果为:hello, world

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions