//
Busca en todas las páginas de la documentación
String everywhere.&str (or impl AsRef<str>) for read-only inputs. Caller flexibility.String when caller owns result. Borrow only when tied to input lifetime.Cow<str> when mutation is rare. Avoid forced allocation.Path/PathBuf for filesystem paths. Not String paths.OsString when preserving non-UTF-8 OS bytes. Windows env vars.str by byte without is_char_boundary. Prevent panics.chars() for Unicode scalars; graphemes for UI. unicode-segmentation.from_utf8. Do not unwrap in production.len() is character count. Document byte length.unicode-normalization if needed.with_capacity when size known. Join/build loops.push_str over + in loops. + moves left operand.String buffers with clear. Hot formatting paths.LazyLock). Not per line.to_string/clone in tight loops. Profile with dhat.unwrap on user data. Return Result.Stack versions: This page was written for Rust 1.97.0 (edition 2024), Tokio 1.x, Axum 0.8, serde 1.0, sqlx 0.8, clap 4, and Polars 0.46+.
Revisado por Chris St. John·Última actualización: 16 jul 2026