@@ -514,15 +514,15 @@ pub struct ReconstructionSettings {
514
514
continuation_str : String ,
515
515
}
516
516
impl ReconstructionSettings {
517
- pub fn new (
518
- newline_str : String ,
519
- indentation_str : String ,
520
- continuation_str : String ,
517
+ pub fn new < S : Into < String > + AsRef < str > > (
518
+ newline_str : S ,
519
+ indentation_str : S ,
520
+ continuation_str : S ,
521
521
) -> Result < Self , InvalidReconstructionSettingsError > {
522
522
for ( name, val) in & [
523
- ( "newline" , & newline_str) ,
524
- ( "indentation" , & indentation_str) ,
525
- ( "continuation" , & continuation_str) ,
523
+ ( "newline" , newline_str. as_ref ( ) ) ,
524
+ ( "indentation" , indentation_str. as_ref ( ) ) ,
525
+ ( "continuation" , continuation_str. as_ref ( ) ) ,
526
526
] {
527
527
if val. is_empty ( ) {
528
528
return Err ( InvalidReconstructionSettingsError :: new ( format ! (
@@ -536,9 +536,9 @@ impl ReconstructionSettings {
536
536
}
537
537
538
538
Ok ( ReconstructionSettings {
539
- newline_str,
540
- indentation_str,
541
- continuation_str,
539
+ newline_str : newline_str . into ( ) ,
540
+ indentation_str : indentation_str . into ( ) ,
541
+ continuation_str : continuation_str . into ( ) ,
542
542
} )
543
543
}
544
544
pub fn get_newline_str ( & self ) -> & str {
0 commit comments