String literals are represented by slices but the slice in this case points to the address in memory where the string literal is stored within compiled binary .
fn main() {
let s: &str = "Hello World!";
/// Hello World! is stored in the compiled binary and it's address is know at compile time, and s is a slice pointing to the whole string in memory
}slice by default is a readonly reference and this why the literals are readonly
fn first_word(s: &str) -> &str {}This function will accept arguments in shape of &String and &str Assuming &String as slice &str[..] from the start to the end of the string