In short : *triggers an explicit partition that can be overloaded through ops::Deref.
More details
Take a look at this code:
let s = "hi".to_string();
let a = &s;
a? &String! , String. , ?
let s = "hi".to_string();
let b = &*s;
b? &str! , ?
, *s. , * , *std::ops::Deref::deref(&s) ( , !). String :
impl Deref for String {
type Target = str;
fn deref(&self) -> &str { ... }
}
, *s *std::ops::Deref::deref(&s), deref() &str, . , *s str ( &).
str , , &str. , & ! , &str!
&*s - . , Deref -overload . , :
fn takes_string_slice(_: &str) {}
let s = "hi".to_string();
takes_string_slice(&s);