Skip to content

Commit

Permalink
Minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Aug 28, 2024
1 parent 6e2a50e commit 28247d7
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion readme/async-disposable-scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ partial class Composition: IDisposable, IAsyncDisposable
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
var perBlockFunc1 = default(Func<Session> );
var perBlockFunc1 = default(Func<Session>);
perBlockFunc1 = new Func<Session>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
Composition transientComposition3 = this;
Expand Down
2 changes: 1 addition & 1 deletion readme/async-root.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ partial class Composition
TaskContinuationOptions localTaskContinuationOptions19 = transientTaskContinuationOptions4;
TaskScheduler localTaskScheduler20 = transientTaskScheduler5;
perBlockTaskFactory2 = new TaskFactory<IService>(localCancellationToken17, localTaskCreationOptions18, localTaskContinuationOptions19, localTaskScheduler20);
var perBlockFunc1 = default(Func<IService> );
var perBlockFunc1 = default(Func<IService>);
perBlockFunc1 = new Func<IService>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
IService localValue21 = new Service(new Dependency());
Expand Down
2 changes: 1 addition & 1 deletion readme/auto-scoped.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ partial class Composition
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
var perBlockFunc1 = default(Func<IService> );
var perBlockFunc1 = default(Func<IService>);
perBlockFunc1 = new Func<IService>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
Composition transientComposition3 = this;
Expand Down
2 changes: 1 addition & 1 deletion readme/func-with-tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ partial class Composition
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
var perBlockFunc1 = default(Func<IDependency> );
var perBlockFunc1 = default(Func<IDependency>);
perBlockFunc1 = new Func<IDependency>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
IDependency localValue32 = new Dependency();
Expand Down
2 changes: 1 addition & 1 deletion readme/func.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ partial class Composition
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
var perBlockFunc1 = default(Func<IDependency> );
var perBlockFunc1 = default(Func<IDependency>);
perBlockFunc1 = new Func<IDependency>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
IDependency localValue30 = new Dependency();
Expand Down
4 changes: 2 additions & 2 deletions readme/generic-async-composition-roots-with-constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ partial class Composition
TaskContinuationOptions localTaskContinuationOptions48 = transientTaskContinuationOptions4;
TaskScheduler localTaskScheduler49 = transientTaskScheduler5;
perBlockTaskFactory2 = new TaskFactory<IService<T, bool>>(localCancellationToken46, localTaskCreationOptions47, localTaskContinuationOptions48, localTaskScheduler49);
var perBlockFunc1 = default(Func<IService<T, bool>> );
var perBlockFunc1 = default(Func<IService<T, bool>>);
perBlockFunc1 = new Func<IService<T, bool>>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
OtherService<T> transientOtherService6;
Expand Down Expand Up @@ -123,7 +123,7 @@ partial class Composition
TaskContinuationOptions localTaskContinuationOptions56 = transientTaskContinuationOptions4;
TaskScheduler localTaskScheduler57 = transientTaskScheduler5;
perBlockTaskFactory2 = new TaskFactory<IService<T, T1>>(localCancellationToken54, localTaskCreationOptions55, localTaskContinuationOptions56, localTaskScheduler57);
var perBlockFunc1 = default(Func<IService<T, T1>> );
var perBlockFunc1 = default(Func<IService<T, T1>>);
perBlockFunc1 = new Func<IService<T, T1>>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
IService<T, T1> localValue58 = new Service<T, T1>(new Dependency<T>());
Expand Down
2 changes: 1 addition & 1 deletion readme/lazy.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ partial class Composition
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
var perBlockFunc2 = default(Func<IDependency> );
var perBlockFunc2 = default(Func<IDependency>);
perBlockFunc2 = new Func<IDependency>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
IDependency localValue33 = new Dependency();
Expand Down
2 changes: 1 addition & 1 deletion readme/manually-started-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ partial class Composition
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public IService GetRoot(CancellationToken cancellationToken)
{
var perBlockFunc2 = default(Func<IDependency> );
var perBlockFunc2 = default(Func<IDependency>);
perBlockFunc2 = new Func<IDependency>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
IDependency localValue35 = new Dependency();
Expand Down
2 changes: 1 addition & 1 deletion readme/scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ partial class Composition: IDisposable
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
var perBlockFunc1 = default(Func<Session> );
var perBlockFunc1 = default(Func<Session>);
perBlockFunc1 = new Func<Session>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
Composition transientComposition3 = this;
Expand Down
2 changes: 1 addition & 1 deletion readme/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ partial class Composition
TaskContinuationOptions localTaskContinuationOptions40 = transientTaskContinuationOptions5;
TaskScheduler localTaskScheduler41 = transientTaskScheduler6;
perBlockTaskFactory3 = new TaskFactory<IDependency>(localCancellationToken38, localTaskCreationOptions39, localTaskContinuationOptions40, localTaskScheduler41);
var perBlockFunc2 = default(Func<IDependency> );
var perBlockFunc2 = default(Func<IDependency>);
perBlockFunc2 = new Func<IDependency>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
IDependency localValue42 = new Dependency();
Expand Down
2 changes: 1 addition & 1 deletion readme/tracking-async-disposable-instances-in-delegates.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ partial class Composition
get
{
var accumulator41 = new Owned();
var perBlockFunc1 = default(Func<Owned<IDependency>> );
var perBlockFunc1 = default(Func<Owned<IDependency>>);
perBlockFunc1 = new Func<Owned<IDependency>>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
var accumulator41 = new Owned();
Expand Down
2 changes: 1 addition & 1 deletion readme/tracking-disposable-instances-in-delegates.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ partial class Composition
get
{
var accumulator41 = new Owned();
var perBlockFunc1 = default(Func<Owned<IDependency>> );
var perBlockFunc1 = default(Func<Owned<IDependency>>);
perBlockFunc1 = new Func<Owned<IDependency>>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
var accumulator41 = new Owned();
Expand Down
4 changes: 2 additions & 2 deletions src/Pure.DI.Core/Core/Code/BuildTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public void AddPureHeader(LinesBuilder code)
code.AppendLine("#endif");
}

public string GetDeclaration(Variable variable) =>
variable.IsDeclared ? "" : $"{typeResolver.Resolve(variable.Setup, variable.InstanceType)} ";
public string GetDeclaration(Variable variable, string separator = " ") =>
variable.IsDeclared ? "" : $"{typeResolver.Resolve(variable.Setup, variable.InstanceType)}{separator}";

public string OnInjected(BuildContext ctx, Variable variable)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Pure.DI.Core/Core/Code/FactoryCodeBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public void Build(BuildContext ctx, in DpFactory factory)
var lines = new List<TextLine>();
if (!variable.IsDeclared && variable.IsLazy)
{
ctx.Code.AppendLine($"var {variable.VariableName} = default({ctx.BuildTools.GetDeclaration(variable)});");
ctx.Code.AppendLine($"var {variable.VariableName} = default({ctx.BuildTools.GetDeclaration(variable, "")});");
variable.IsDeclared = true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Pure.DI.Core/Core/Code/IBuildTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ internal interface IBuildTools
{
void AddPureHeader(LinesBuilder code);

string GetDeclaration(Variable variable);
string GetDeclaration(Variable variable, string separator = " ");

string OnInjected(BuildContext ctx, Variable variable);

Expand Down

0 comments on commit 28247d7

Please sign in to comment.