File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -406,8 +406,7 @@ pub trait ConnectorResultExt {
406406impl < T > ConnectorResultExt for ConnectorResult < T > {
407407 fn with_context ( self , context : & ' static str ) -> Self {
408408 self . map_err ( |mut e| {
409- e. context = context;
410- // e.set_context(context);
409+ e. set_context ( context) ;
411410 e
412411 } )
413412 }
Original file line number Diff line number Diff line change 11#![ cfg_attr( doc, doc = include_str!( "../README.md" ) ) ]
22#![ doc( html_logo_url = "https://cdnweb.devolutions.net/images/projects/devolutions/logos/devolutions-icon-shadow.svg" ) ]
33#![ cfg_attr( not( feature = "std" ) , no_std) ]
4- #![ expect( clippy:: partial_pub_fields) ]
54
65#[ cfg( feature = "alloc" ) ]
76extern crate alloc;
@@ -24,8 +23,8 @@ impl<T> Source for T where T: fmt::Display + fmt::Debug + Send + Sync + 'static
2423
2524#[ derive( Debug ) ]
2625pub struct Error < Kind > {
27- pub context : & ' static str ,
28- pub kind : Kind ,
26+ context : & ' static str ,
27+ kind : Kind ,
2928 #[ cfg( feature = "std" ) ]
3029 source : Option < Box < dyn core:: error:: Error + Sync + Send > > ,
3130 #[ cfg( all( not( feature = "std" ) , feature = "alloc" ) ) ]
@@ -81,6 +80,10 @@ impl<Kind> Error<Kind> {
8180 & self . kind
8281 }
8382
83+ pub fn set_context ( & mut self , context : & ' static str ) {
84+ self . context = context;
85+ }
86+
8487 pub fn report ( & self ) -> ErrorReport < ' _ , Kind > {
8588 ErrorReport ( self )
8689 }
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ pub trait SessionResultExt {
110110impl < T > SessionResultExt for SessionResult < T > {
111111 fn with_context ( self , context : & ' static str ) -> Self {
112112 self . map_err ( |mut e| {
113- e. context = context ;
113+ e. set_context ( context) ;
114114 e
115115 } )
116116 }
You can’t perform that action at this time.
0 commit comments