Macro magnus::r_string

source ·
macro_rules! r_string {
    ($lit:expr) => { ... };
    ($ruby:expr, $lit:expr) => { ... };
}
Expand description

Create a RString from a Rust str literal.

§Panics

Panics if called from a non-Ruby thread.

§Examples

use magnus::{r_string, rb_assert};

let s = r_string!("Hello, world!");
rb_assert!(r#"s == "Hello, world!""#, s);