implicit-clone icon indicating copy to clipboard operation
implicit-clone copied to clipboard

Possibly add utility extension traits for quick conversion into immutable types

Open kirillsemyonkin opened this issue 9 months ago • 3 comments

Add to_istring() and similar methods to applicable types, so that it is possible to use a more precise method than into(), without using path-ful calls like IString::from(Rc::from(...)).

May aid with #56, but it might also have the implementation collision akin to having both From<&'static str> and From<&'a str>. In this case it might be probable to make the two do different behaviors: .to_istring() would be always cloning/copying, and would always turn &'static str into an IString::Rc. Also consider even more precise to_istring_static and to_istring_rc (these method names might be too verbose).

Also consider .collect_iarray() and similar, akin to itertools's collect_vec.

kirillsemyonkin avatar Mar 01 '25 14:03 kirillsemyonkin