mirror of
https://github.com/Noratrieb/mono-fmt.git
synced 2026-01-14 15:25:08 +01:00
Take references to input
This commit is contained in:
parent
d4ac7596da
commit
61814d9a6d
5 changed files with 27 additions and 11 deletions
|
|
@ -35,4 +35,18 @@ fn dont_move() {
|
|||
let string = "uwu".to_string();
|
||||
let _ = format!("{string}");
|
||||
assert_eq!("uwu", string);
|
||||
|
||||
let string = "owo".to_string();
|
||||
let _ = format!("{0}{0}", string);
|
||||
assert_eq!("owo", string);
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn ptr_correct_addr() {
|
||||
static STATIC: u8 = 0;
|
||||
let addr = std::format!("{:p}", (&STATIC) as *const u8);
|
||||
let fmt = format!("{:p}", &STATIC);
|
||||
|
||||
assert_eq!(addr, fmt);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue