Pls explain difference between both cases(notice 2 lifetimes removed of 1).
In one of codebase doing so caused lifetime issues (that codebase had single lifetime).
We can further expand that, not just eliding the lifetimes but also replacing the self sugar with the actual parameter type:
pub fn as_str(self: &'b Cursor<'a>) -> &'b str
The returned &str contains the lifetime of a borrow of a Cursor instead of the borrow of the original str the Cursor was created with. Thus, you only get to use it as long as your borrow of the Cursor exists, which is more restrictive than returning &'a str that can outlive the borrow of the Cursor (and outlive the Cursor itself too).
All choices in function signatures are tradeoffs between what they allow the caller to do and what they allow the callee to do.
-> &'a str gives more flexibility to the caller, but means as_str() can't ever return a borrow of data the Cursorowns. For a cursor type that borrows input, that's probably the right choice.