File tree Expand file tree Collapse file tree 4 files changed +7
-10
lines changed Expand file tree Collapse file tree 4 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ The following OpenCV versions are supported at the moment:
163163
164164### Minimum rustc version (MSRV)
165165
166- Currently, Rust version 1.77 .0 or later is required. General policy is that rust version from 1 year ago is supported.
166+ Currently, Rust version 1.81 .0 or later is required. General policy is that rust version from 1 year ago is supported.
167167Bumping versions older than that is not considered a breaking change.
168168
169169### Platform support
Original file line number Diff line number Diff line change 11use std:: borrow:: Cow ;
2- use std:: fmt:: Write ;
32
43use clang:: token:: { Token , TokenKind } ;
54use clang:: { Entity , EntityKind , EvaluationResult } ;
@@ -142,7 +141,9 @@ impl Value {
142141 for t in tokens {
143142 match t. get_kind ( ) {
144143 TokenKind :: Comment => {
145- write ! ( out. value, "/* {} */" , t. get_spelling( ) ) . expect ( "write! to String shouldn't fail" ) ;
144+ out. value . push_str ( "/* " ) ;
145+ out. value . push_str ( & t. get_spelling ( ) ) ;
146+ out. value . push_str ( " */" ) ;
146147 }
147148 TokenKind :: Identifier => {
148149 let spelling = t. get_spelling ( ) ;
@@ -188,7 +189,7 @@ impl Value {
188189 if spelling == "{" || spelling == "}" {
189190 return None ;
190191 }
191- out. value += & t . get_spelling ( ) ;
192+ out. value += & spelling ;
192193 }
193194 }
194195 }
Original file line number Diff line number Diff line change @@ -99,11 +99,7 @@ fn get_definition_text(entity: Entity) -> String {
9999}
100100
101101fn reserved_rename ( val : Cow < str > ) -> Cow < str > {
102- if let Some ( & v) = settings:: RESERVED_RENAME . get ( val. as_ref ( ) ) {
103- v. into ( )
104- } else {
105- val
106- }
102+ settings:: RESERVED_RENAME . get ( val. as_ref ( ) ) . map_or ( val, |& v| v. into ( ) )
107103}
108104
109105#[ inline( always) ]
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ impl RustElement for Class<'_, '_> {
3737 if self . string_type ( ) . is_some ( ) {
3838 "String" . into ( )
3939 } else {
40- let cpp_declname = self . cpp_name ( CppNameStyle :: Declaration ) ;
40+ let cpp_declname = DefaultRustNativeElement :: rust_leafname ( self ) ;
4141 if cpp_declname == "Vec" {
4242 "VecN" . into ( )
4343 } else {
You can’t perform that action at this time.
0 commit comments