salsa: Fix warnings about clippy str_to_string rule
This commit is contained in:
parent
cee3c22ae8
commit
283b140321
1 changed files with 18 additions and 18 deletions
|
|
@ -44,47 +44,47 @@ impl salsa::InternKey for InternKey {
|
|||
#[test]
|
||||
fn test_intern1() {
|
||||
let db = Database::default();
|
||||
let foo0 = db.intern1("foo".to_string());
|
||||
let bar0 = db.intern1("bar".to_string());
|
||||
let foo1 = db.intern1("foo".to_string());
|
||||
let bar1 = db.intern1("bar".to_string());
|
||||
let foo0 = db.intern1("foo".to_owned());
|
||||
let bar0 = db.intern1("bar".to_owned());
|
||||
let foo1 = db.intern1("foo".to_owned());
|
||||
let bar1 = db.intern1("bar".to_owned());
|
||||
|
||||
assert_eq!(foo0, foo1);
|
||||
assert_eq!(bar0, bar1);
|
||||
assert_ne!(foo0, bar0);
|
||||
|
||||
assert_eq!("foo".to_string(), db.lookup_intern1(foo0));
|
||||
assert_eq!("bar".to_string(), db.lookup_intern1(bar0));
|
||||
assert_eq!("foo".to_owned(), db.lookup_intern1(foo0));
|
||||
assert_eq!("bar".to_owned(), db.lookup_intern1(bar0));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_intern2() {
|
||||
let db = Database::default();
|
||||
let foo0 = db.intern2("x".to_string(), "foo".to_string());
|
||||
let bar0 = db.intern2("x".to_string(), "bar".to_string());
|
||||
let foo1 = db.intern2("x".to_string(), "foo".to_string());
|
||||
let bar1 = db.intern2("x".to_string(), "bar".to_string());
|
||||
let foo0 = db.intern2("x".to_owned(), "foo".to_owned());
|
||||
let bar0 = db.intern2("x".to_owned(), "bar".to_owned());
|
||||
let foo1 = db.intern2("x".to_owned(), "foo".to_owned());
|
||||
let bar1 = db.intern2("x".to_owned(), "bar".to_owned());
|
||||
|
||||
assert_eq!(foo0, foo1);
|
||||
assert_eq!(bar0, bar1);
|
||||
assert_ne!(foo0, bar0);
|
||||
|
||||
assert_eq!(("x".to_string(), "foo".to_string()), db.lookup_intern2(foo0));
|
||||
assert_eq!(("x".to_string(), "bar".to_string()), db.lookup_intern2(bar0));
|
||||
assert_eq!(("x".to_owned(), "foo".to_owned()), db.lookup_intern2(foo0));
|
||||
assert_eq!(("x".to_owned(), "bar".to_owned()), db.lookup_intern2(bar0));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_intern_key() {
|
||||
let db = Database::default();
|
||||
let foo0 = db.intern_key("foo".to_string());
|
||||
let bar0 = db.intern_key("bar".to_string());
|
||||
let foo1 = db.intern_key("foo".to_string());
|
||||
let bar1 = db.intern_key("bar".to_string());
|
||||
let foo0 = db.intern_key("foo".to_owned());
|
||||
let bar0 = db.intern_key("bar".to_owned());
|
||||
let foo1 = db.intern_key("foo".to_owned());
|
||||
let bar1 = db.intern_key("bar".to_owned());
|
||||
|
||||
assert_eq!(foo0, foo1);
|
||||
assert_eq!(bar0, bar1);
|
||||
assert_ne!(foo0, bar0);
|
||||
|
||||
assert_eq!("foo".to_string(), db.lookup_intern_key(foo0));
|
||||
assert_eq!("bar".to_string(), db.lookup_intern_key(bar0));
|
||||
assert_eq!("foo".to_owned(), db.lookup_intern_key(foo0));
|
||||
assert_eq!("bar".to_owned(), db.lookup_intern_key(bar0));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue