fix: profile_tokio broken due to incompatible types #49
@@ -17,6 +17,7 @@ pub fn new<
|
||||
#[cfg(feature = "profile_tokio")]
|
||||
|
|
||||
let result = tokio::task::Builder::new()
|
||||
.name(name_fn().as_ref())
|
||||
.spawn(async_future);
|
||||
.spawn(async_future)
|
||||
.map_err(Into::into);
|
||||
result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user
⚠️ Potential issue
Fix: Builder::spawn returns JoinHandle, not Result; remove map_err and wrap in Ok(...)
.spawn(async_future)returnsJoinHandle<O>. There’s nothing to map viamap_err; this won’t compile. To keep the return typeResult<JoinHandle<O>>consistent with the non-profile_tokiobranch, wrap the spawn inOk(...).Apply this diff:
And wrap the whole expression in
Ok(...):🤖 Prompt for AI Agents